Can you explain a little more what you're doing? That explanation didn't make a lot of sense...I can't think of why you would want to add a variable up to different values as you put on multiple pieces of equipment, then make it zero as soon as you take one off.
If you can explain the situation a bit more clearly it might help us understand how to help you, or explain why a different solution might work better.
Ah ok let me re-try
So
1 : I made a plugin that switches images based on variable value (1 = Heavy Armor, 2 = Light Armor)
i do this as it allows me to have a fully foldered picture section that allows for a one common event picture equip system.
2 : I use triaconte equip plugin to change the variable on equip
i,e you equip silver helmet (increase variable to 1, other plugin recognises the 1 and changes the picture to silver helmet)
2b : If you unequip it minuses 1 leaving you at zero that erases the helmet picture.
3: Now in battle if you drop below 25% health i have it increase the variable to 2, which equals 'battered helmet'
4: Issue is with this if player wins or escapes and unequips the item it minuses 1 leaving a value of 1 instead of zero.
---
2 unideal workaround i have is to on the escape and win conditions have it look for player health and minus the relevant variable back down to the orginal.
I dont like this as player would then have full health armor again despite being at 25% health and cant walk around in the banged up armor.
Second is to scrap the armor damage event but i kinda like the immersion it gives
Thus the best solution is instead of increase and decreasing variable is tweak the unequip function so it sets to zero