Some 24 million people avoided what could have proven to be fiscal and personal ruin in their lives when congressional Republicans and President Donald Trump last month dropped their plan to repeal Obamacare and replace it with something inferior. According to the Congressional Budget Office, 24 million is the number of people who would have lost their health insurance within a decade under the Republicans’ plan.

At the same time as people’s health insurance coverage was spared, states such as Maine avoided what could have proven to be fiscal ruin for their state finances when Republicans dropped their Obamacare replacement.

That’s because in addition to reversing the coverage gains of the Affordable Care Act, the GOP’s legislation, the American Health Care Act, would have fundamentally changed how states and the federal government pay for Medicaid, the five-decade-old program that provides health coverage for people with low incomes and disabilities.

Today, Medicaid is by far Maine’s largest source of federal funds. The program — which provides health coverage to people with low incomes and disabilities as well as elderly residents in nursing homes — accounts for 62 percent of all the federal funds that flow into Maine.

In the five decades since Medicaid took effect, the federal government and states have been partners in paying for Medicaid services. This year, for every dollar of its own money Maine spends on Medicaid, the federal government chips in $1.81, ultimately covering more than 64 percent of total Medicaid costs. There’s no limit to the amount the federal government will chip in. The model allows state Medicaid programs the ability to respond to crises that leave their populations without health coverage — such as a recession — or with unreasonably high medical costs, such as the introduction of an exorbitantly priced but critical prescription drug.

But the American Health Care Act would have turned that model on its head. As written, the legislation would have instituted a per-person cap on the amount of funding the federal government would send to states, with the cap taking effect in 2020 based on 2016 spending.

No longer would states have Medicaid programs that could respond to their populations in times of need.

“Currently, Medicaid can be and is very responsive to unexpected costs to the health care system,” said Patricia Boozang, senior managing director at Manatt Health, who put together a recently released analysis on how Maine could be affected by such limitations on Medicaid spending. “While the Medicaid program today can be nimble and stretched, a capped funding contract really can’t be responsive to those costs.”

With funding capped based on states’ historic spending, Maine would be locked into some of the lowest per-person spending in the country, Boozang’s analysis points out. In 2011, Maine’s spending per enrollee for adult Medicaid recipients was second lowest in the country; it was 20th lowest in the country for people with disabilities.

A funding cap would heighten pressure to cut Medicaid costs, regardless of whether those cuts represent sound policy. And Maine people with disabilities and elderly residents could bear the brunt of those cost-cutting efforts. After all, in 2011, elderly and disabled Medicaid enrollees accounted for 75 percent of Maine’s Medicaid spending, even though they accounted for just 38 percent of the people enrolled.

In total, the Center on Budget and Policy Priorities estimated that the American Health Care Act’s Medicaid changes would shift $370 billion in costs to states over the next decade. More meager state budgets would have to absorb the financial risks of an economic downturn or a spike in health care costs instead of a federal government better able to respond to crises.

The American Health Care Act didn’t come up for a vote in March, but Republicans are still working on Obamacare repeal plans. Any new proposal could include fundamental changes to the way states and the federal government pay for Medicaid.

If a cap on Medicaid funding became law, Maine’s state budget would be among the losers. So would 267,000 Maine residents who depend on Medicaid in their times of need.