Question regarding damage formulas and variables

I was wondering if I could create a variable to be used in a damage formula. The variable would be increased depending on the gear worn.
How would I make this apply to all characters individually instead of globally?

How would I create the gear to only increase the variable if the gear is being worn, and revert back to the variables original value when the gear is unequipped?
bump

Original thread: https://forums.rpgmakerweb.com/threads/question-regarding-damage-formulas-and-variables.122052/