Weapon mastery system (using states?)

Hi there!
I am trying to create a weapon mastery system for my game. I have several categories for weapons (sword, axe, mace etc.) and I want to create skills for my characters that improve ATK when a certain kind of weapon is equipped. For example, Sword Mastery I is a skill which gives +3 ATK when a sword is equipped.

I don't know if it is the correct way to do what I want to do, but I have created a Sword Mastery I skill with <Passive States: 31>. State 31 gives +3 ATK. (I am using Visustella free plugins).

The problem now is that the character always has +3 ATK, even if he has no weapon equipped at all!

So, I believe now that I should enable/disable State 31 if the corresponding weapon category is equipped, but I don't know how to do so.

Do you have any suggestion?

Original thread: https://forums.rpgmakerweb.com/threads/weapon-mastery-system-using-states.152559/