MV How to make an accessory that boosts stats while weilding a specific weapon?

Hey all - I was inspired to do something like in Chrono Trigger, where if Frog has the Hero's Badge/Hero Medal equipped, then he has an increased crit rate while using the Masamune - and I was wondering if something like this is possible in MV, with or without plugins.
if you were just going for a parameter increase you could use Yanfly's equip core to do it on the acc itself, but since you essentially want to add traits I think it'd be best making it a passive with yanfly's passive state plugin. youd give the accessory a passive state that increases crit and then give it a condition that the user needs the sword equipped for it to be active.
if you were just going for a parameter increase you could use Yanfly's equip core to do it on the acc itself, but since you essentially want to add traits I think it'd be best making it a passive with yanfly's passive state plugin. youd give the accessory a passive state that increases crit and then give it a condition that the user needs the sword equipped for it to be active.

That's what I would do.
I think I understand the passive state part, it'd just be in the accessory's note field, but, how would I program the state to have the weapon, specifically? I'm not great at javascript, so I'm not sure what it would be...
how would I program the state to have the weapon, specifically
put this in the state's notebox and replace the x with the id for your special weapon
Code:
<Custom Passive Condition>
condition = user.isEquipped($dataWeapons[x])
</Custom Passive Condition>
I'll give it a shot, thank you!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-an-accessory-that-boosts-stats-while-weilding-a-specific-weapon.178389/