Need help with Javascript $calc

So I have a Javascript "$calc.shield= 2;" which gains me shield like an extra HP but blue. how can i set it so that lets say i have 9 shields and the max is 10 so how can i make the script to give me shield of to a max of 10 and not go over it?
if its a plugin, we need to know the plugins name/link to it if you want more help.
we cant just guess the plugin and give your the wrong answer.
Do you use that in a script call? Or it is inside a specific plugin?

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-javascript-calc.117935/