Saving variable inside a nodes property

Hey,
Lets say i want to be able to change a property inside a node like the gauge. How would i do it and how could i modify that variable inside a function?

If you are talking about the Ui-gauge, you send it data From another node. If that is not the case please explain what you want to do a bit more

as in the max value can be changed through buttons or any other property really

You can use the msg.ui_control property to modify the configuration of some ui nodes. What properties you can modify, and how to do it, is documented here: https://github.com/node-red/node-red-dashboard/blob/master/config-fields.md