Skilltree general variable?

Hello, I have a slightly strange request here.

I’d like to create a skilltree for LARP character creation on the site. The user would have togglable buttons arranged in a skilltree fashion and they could pick a certain value worth of abilities from the tree while some might have prequisites.

The most simplistic idea I’d have would be to use a global number value and simply subtract some fixed values when a button is toggled and possibly add them back if they toggle it back.

However, I have not for the life of me been able to find how to do something like this. Just adding a simple global numerical variable that can be altered by all of the toggles.

Could anyone help in this regard?