A federal court striking down the state’s $100 million surcharge on opioids will hurt the effort to fight addiction, Moody’s Investor Services found in a report released Friday.

The surcharge, which would have raised $100 million a year through June 2024, would have gone toward a special fund on the first of the year for treatment and support programs for addiction.

New York is one of 23 states that saw increases in drug deaths in 2017, though deaths per 100,000 stood at 19.4, short of the 21.7 deaths nationwide.

The court decision could require the state to decide whether to use existing sources of money to support addiction programs, the report found.

“The state may yet be able to raise revenue from opioid-related businesses in a way that will pass muster with the courts,” Moody’s found. “The federal court ruling found that the flaws in the state’s approach stemmed from its efforts to prevent the affected companies from passing through the impacts of the surcharge to customers and suppliers. The state would have imposed steep penalties on those found to do so, reflecting legislators’ wishes to avoid imposing higher costs on those with legitimate medical need for opioids.”