With an estimated $1.2 billion available above this year's budget—and off-the-cuff predictions of maybe $2 billion when a new estimate arrives next month—New Mexico lawmakers might expect their final planning meetings to be lighthearted as they consider an embarrassment of riches. That's better than a sixth of the state budget, after all. Maybe as much as third. And it's all ready to spend.

One look at almost any public pension fund will cure that.

This week, the Investments and Pensions Oversight Committee stared into the gaping maw that is the $18 billion gap between the benefits that public pensions and other programs owe to more than 200,000 current workers and retirees and what they can currently cover.

The Educational Retirement Board, the pension for former teachers and other educational professionals, won't be fully funded for 70 years. For nearly all other public employees from cops to county clerks, their pension's governing board hasn't even decided what to do about the problem—one that's grown by $1 billion just in the last fiscal year. When it comes to health care benefits for retirees, the state's obligations are $4.5 billion more than its cash on hand.

All the while, bond rating agencies—which effectively set the cost for the state to borrow hundreds of millions of dollars each year for firehouses, libraries, senior centers, schools and other one-time expenditures—are watching closely to see if the state can, in the words of a Moody's ratings analyst, stop "treading water." The agency downgraded the state's rating this summer.

The longer the state waits, experts say, the more it costs every one of the taxpayers who effectively back the bonds sold for all those projects.

It's not as though New Mexico hasn't seen this coming, or hasn't tried to fix it before.

In 2010, the educators' fund stiffened retirement requirements. In 2013, lawmakers and the governor passed a pension reform package that pushed back insolvency. But because, at least in part, the reforms impact primarily new employees, it will likely be an estimated two decades before the funds start to see the benefit of the changes.

That means the 2013 reform package is working, according to Wayne Propst, the executive director of the Public Employees Retirement Association. The problem, he told legislators, is "getting between here and there over the next 20 years."

Jan Goodwin, who leads the New Mexico Educational Retirement Board, told lawmakers that if the state can shore up the ERB's fund with a series of changes designed to get it fully funded in 30 years as opposed to 70, it can make a huge dent in the $50 billion it would cost to cover the gap between contributions and benefits paid out over that period of time.

Source: RHCA, ERB, PERA

It's a somewhat complicated equation, but in essence, the more money the state can throw at the problems now, the more time the power of compounded interest and investment earnings will have to shore up the funds. Right now, funds like the ERB aren't taking in enough money to cover the benefits they're paying out, as well as to chip away at the multi-billion-dollar deficits they have. So instead of the problem getting better, it's getting worse.

All the while, bond rating agencies are lurking like a bully around the corner, ready to sock the state's costs to fund all those school projects and senior centers.

To avoid the gut-punch, two of the three funds have proposed changes to retirement rules, with the PERA board expected to recommend fixes after an emergency meeting in December.

That's where all the extra money predicted for New Mexico next year comes in.

The Retiree Health Care Authority wants to boost contributions to its fund from public agencies over the next two years. That would ultimately cost $22.7 million per year. While the state does that, it would also ask current employees to pay more to the fund starting in two years. The effect of that change would be enough, the authority predicts, to keep it solvent into the second half of this century.

The Educational Retirement Board wants to make a series of changes to bring itself to full funding in 30 years. They include weighting pension benefits toward teachers who decide to stay in New Mexico longer, adding three years to the retirement age at which teachers can quit without losing benefits, and boosting what employers pay toward retirement by 3 percent over three years. That would add $81 million to the state's costs every year.

The Public Employees Retirement Association is stuck. It still can't decide what to do. The most likely scenario includes freezing cost-of-living increases to retirees for three years. The fund has been overpaying those adjustments for years, with retirees getting their monthly payments boosted by more than the rate of inflation. The board is also kicking around the idea of asking for a lump sum injection of around $100 million into the fund.

Something has to be done, warned Sen. George Muñoz, D-Gallup, or the bond rating agencies will ding the state again.

Often, Muñoz acknowledged, the most meaningful changes like reducing cost-of-living payments or trimming benefits for future public employees are wildly unpopular with workers. What's more, New Mexico sees the right to a public pension as akin to property rights. A few years ago, the state diverted money designated for pension funds to help patch huge holes in the state budget. The public employees union AFSCME sued, arguing the state infringed on that retirement right. Now, as part of a settlement, the funds are asking for more than a quarter of a billion dollars to be injected back into the retirement accounts.