House Republicans are planning to hold a vote on Thursday on a controversial plan to repeal and replace the Affordable Care Act, expressing confidence that they had the votes to pass it.

Majority leader Kevin McCarthy, emerging from a meeting in the office of House speaker Paul Ryan on Wednesday evening, told reporters that Republicans had at least 216 yes votes and would vote on the bill on Thursday.

“Do we have the votes? Yes. Will we pass it? Yes,” McCarthy told reporters with a broad smile.

The House rules committee was due to debate the bill on Wednesday night, allowing it to move to the full House floor the following day.

The frenetic push to fulfill a signature campaign promise gained momentum on Wednesday as lawmakers tinkered with the bill to try to address concerns that the plan would hurt people with preexisting medical conditions.

The vote will be a defining one for Donald Trump’s presidency, especially after passing his 100-day mark without a legislative victory to tout. Trump devoted much of Tuesday and Wednesday to trying to win over wary Republicans, and on Wednesday he won over two key Republican skeptics of the repeal plan for the current healthcare law, also called Obamacare, after inviting them for a meeting at the White House.

Why is healthcare so expensive in the USA? It’s the prices. That’s not a joke. Drugs, diagnostics, medical devices, doctor visits, hospital visits, procedures, scans, surgeries – “the United States spends more on health care than any of the other OECD countries spend, without providing more services than the other countries do ​, ​”, according to a widely cited 2003 paper on the topic entitled It’s the Prices, Stupid. Why are prices so high? In short, lack of a national system. The US system is employer-based, with most Americans – about 150 million non-elderly people – getting insurance through their employers, instead of straight from Washington. No national system means there is no single authority – no single payer – to go to bat on behalf of the consumer, although the big public healthcare programs, Medicare and Medicaid, do negotiate with providers on some costs. US healthcare providers can therefore get away with charging more, as can medical device manufacturers and drug makers. Doctors can order more tests, ambulances can charge more for transport and, on the other side, insurance companies can put up stronger resistance to paying claims, or charge more for coverage. The enormous inefficiency of the system is itself costly, as all sides have to spend money on analysts and lawyers and bookkeepers and anxiety medication. Why can’t market forces resolve the problem? Because it’s a highly irregular market, with highly localized supply and demand, instantly fluctuating demand (from no-need to need-now-at-any-price) and high barriers to entry for would-be suppliers of insurance, pharmaceuticals, or care itself. Tom McCarthy

The president persuaded Fred Upton of Michigan and Billy Long of Missouri, two normally loyal Republicans who had balked at the bill’s provision to remove protections for those with preexisting conditions, with the promise of $8bn in extra funding to subsidize healthcare for those affected.

With many moderate Republicans still wary of the proposal, the White House engaged in a full-scale effort to woo skeptics on Wednesday. Trump put his deal-making skills to the test, working the phones and appealing personally to lawmakers, while Mike Pence and the White House budget director, Mick Mulvaney, were dispatched to the Capitol to convince wavering members.

The efforts, including the extra $8bn in funding, were not, however, necessarily a sell for many wavering moderates. Ryan Costello of Pennsylvania told reporters that he still had fundamental concerns about “the underlying policy”. Several other lawmakers echoed his sentiment, telling reporters they remained a “no” as they shuffled on to the floor for afternoon votes. Moderate Leonard Lance of New Jersey insisted: “I’m a no. It’s a two-letter word. N in the front. O in the back. I’m not a hard no, a soft no, or a middle no. I’m a no.”

In a break from past divisions in the House Republican caucus, conservatives were solidly behind the effort. Mark Meadows, chair of the hard-right Freedom Caucus, told reporters that his faction was still solidly behind the proposal, which had been crafted to attract their support, and said that the modification to add the additional $8bn in spending hadn’t led to any defections.

Despite the majority leader’s confidence, Thursday’s vote is expected to be a nail-biter. The party needs at least 216 votes to pass the measure, meaning they can only afford to lose 22 votes if all Democrats oppose the bill as expected. On Wednesday, at least 18 Republicans publicly opposed the bill and as many as two dozen remained undecided, according to counts maintained by news organizations.

Asked what the impact would be if House leadership had to pull the bill again due to a lack of support, McCarthy said: “We’re going to pass it. Let’s be optimistic about life!”

The push to bring Republicans onboard was somewhat successful with Steve King of Iowa, who said he was moved from a “no” to a “lean yes” on the bill after receiving a personal call from the president.

“As the calendar ticks another page or two, we either get something done or we live with Obamacare, that’s a part of it,” King said, describing his change of heart on the legislation.

But in a sign of just how politically fraught negotiations over healthcare reform have become, the co-chair of a moderate Republican group was dogged by questions not about the bill but about his standing with moderates. A report on Wednesday suggested that Tuesday Group members furious with Tom MacArthur for forging an agreement with the Freedom Caucus were plotting to oust him as co-chair.

Asked on Wednesday if he would remain a part of the moderate coalition, MacArthur said: “Of course, these are my closest colleagues. These are people in districts like my mine and among my closest friends here in Congress.”

Since the first attempt at healthcare reform failed to win enough support from House Republicans in March, lawmakers revised the measure to remove protections for people with preexisting conditions, a change that brought on board conservatives who were initially opposed. But moderates are reluctant to line up behind a bill that would undermine protections for sicker Americans, one of the Affordable Care Act’s most popular provisions.

The revised Republican plan would permit states to apply for waivers that allow them to opt out of a handful of crucial mandates in the Affordable Care Act. And under the proposal, states, if they meet certain conditions, could allow insurers to charge sicker enrollees more.

Republican leadership has maintained that the bill provides “several layers” of protection for people with preexisting conditions.

Ryan has said sicker Americans would be “better off” under the Republican plan. And in the lunchtime interview, he denied that the proposal would hurt them, calling those concerns “more about perception than the actual reality of the bill itself”.

Spicer acknowledged that there were still uncertainties over costs relating to individuals with preexisting conditions. “Right now, preexisting conditions are covered in the bill,” he said. “They always have been; we’ve talked about that before. States have the right to receive a waiver. If someone has continuous coverage, that’s never going to be an issue, regardless. In no circumstance would anyone with continuous coverage ever have a problem.”

Democrats dismissed the plan as an inadequate gesture. In a statement, the Senate Democratic leader, Chuck Schumer, described it as akin to “administering cough medicine to someone with stage four cancer”.

“This Republican amendment leaves Americans with pre-existing conditions as vulnerable as they were before under this bill,” he said. “High-risk pools are the real death panels: they mean waiting forever in line for unaffordable health insurance.”

Additional reporting by David Smith in Washington