Hello discordiandreams,
I've been thinking about your questions for awhile and I don't think this can be done easily by changing the Javascript.
You could go achieve something similar in another way. You could create items that would be used to unlock the higher nodes. This would limit the amount of higher nodes by the amount of items you give the player. The skill tree would be have one lane per skill with 4 nodes. Each node would require another item. Like T1 Skill Crystal, T2 Skill Crystal, T3 Skill Crystal and T4 Skill Crystal.
That way you would somewhat achieve what you want.
Best regards,
Felski