States working with Equipment on only

Hi there.
I had an idea where certain states would only work if you have certain equipment on, like Weapon types.
Think something like "Sword Mastery I" state that gives you Attack bonus but only if you have a Sword on, yade-yade-yada

And while we're at it, is there a way to disable other Weapon types if other equipment is on?
For example, an accessory "Sheath" prevents you from equipping any other Weapon types except for Swords. Not to be confused with disabling Weapons equipped overall

If it helps, I have Yanfly plugins
Thank you very much
Sounds like Yanfly's Buffs & States Core and Auto Passive States are the plugins you'd want to use 🙂 But at first could you share how you want to these states to be apllied? Like, if you want to have a Skill which gives you Sword Mastery I, than it seems to be better to make the Skill only work with a sword equpped, right?

Or would you want to have the state to automatically activate whenever a sword is equipped?
I had an idea where certain states would only work if you have certain equipment on, like Weapon types.
Think something like "Sword Mastery I" state that gives you Attack bonus but only if you have a Sword on, yade-yade-yada
A similar thing was asked the other day.
Like i said back then, itd just be easier to make it so that the state cant be put on a battler without the corresponding weapon in the first place since you cant add conditions to traits, but you can follow the thread and use passives to fake it by giving all swords a hidden sword mastery passive state and using a separate visible sword mastery active state to activate it.

And while we're at it, is there a way to disable other Weapon types if other equipment is on?
For example, an accessory "Sheath" prevents you from equipping any other Weapon types except for Swords. Not to be confused with disabling Weapons equipped overall
Yanfly has a plugin specifically for adding requirements to equipment. that being said, itd be much easier making it so that the sheath requires holding a sword than itd be to make all non swords require not holding a sheath.
Thank you for your replies, sorry for responding late.

To answer on adding Weapon requirement to my passive skills: no, it didn't work, I added passive state on it, slapped Weapon requirement to "Sword," it worked just as a normal passive skill that grants state.

Thanks to Robro33 for this solution, tho:
<Custom Passive Condition>
condition = user.isStateAffected(--);
</Custom Passive Condition>
Was a very simple solution to my request, I just made it so each weapon grants hidden state that "confirms" it being equipped to its type, and now my Weapon-specific passives work as intented, thank you very much

And yes, Yanfly's Item Requirement was exactly what I needed for my Sheath accessory, it was quite deep in the list, so I kinda missed it, my bad, lol

Thank you again for your replies

Original thread: https://forums.rpgmakerweb.com/threads/states-working-with-equipment-on-only.176879/