Paying student loans from 529s and NY state recapture

I asked this question on another forum, but thought I’d ask here as the response was light. I want to make repayments of student loans making qualified 529 withdrawals. I understand that with somewhat recent law changes, repayments of up to $10K qualify. Some states do not consider such a withdrawal as qualified even though it is qualified on a federal level. From NY’s 529 website: “Under New York State law, these distributions are considered nonqualified withdrawals and will require the recapture of any New York State tax benefits that have accrued on contributions.”

As an example, if I contributed $15K to NY’s 529 plan (the max a MFJ couple con contribute in a year and get a NY state tax deduction is $10K) and then paid off $5K of loans from 529 distributions, would NY recapture laws apply? The quote above makes me think yes. However, after going through the tax worksheet and playing around in Turbotax, I believe the answer is no. It is my understanding that NY recapture rules are only triggered when the amount of total unqualified withdrawals is greater than the total 529 contributions that were not deducted on NY returns. Gains on contributions are not part of the worksheet. So, in this small example, $15K (total contributions) minus $10K (contributions that had NY deductions) is greater than or equal to the unqualified withdrawals, so no recapture rule applies.

Anyone have any insight into this?

You need to add back the NY state income tax deduction that you claimed when you made the contribution.
See 2019 instructions on IT-201 Line 22

Here is the worksheet from 2019’s taxes to determine NY’s recapture:

1 Total current and prior years’ nonqualified withdrawals from your account(s)
2 Total current and prior years’ contributions to your account(s)
3 Total current year’s subtraction modification (from line 1 of Worksheet for line 30) and prior years’ subtraction modifications*
4 Subtract line 3 from line 2
5 Total prior years’ addition modifications*
6 Add lines 4 and 5
7 Subtract line 6 from line 1. This is your current year addition modification. Enter this amount on Form IT-201, line 22. If line 7 is 0 (zero) or less, there is no entry required on Form IT-201, line 22.

Subtraction modifications are amounts that have been deducted on NYS taxes

All that is being done here is contributions that have not been deducted are subtracted from the nonqualified withdrawals. If negative, meaning you have more contributions that have not been deducted than nonqualified withdrawals, then there is no recapture. That is the whole calculation. So, it is only added back when you have you have more nonqualified withdrawals than contributions that had no NY state deductions. At least that is my interpretation of this worksheet.