MV Multiple conditions for YEP Weapon Unleash?

Hi, so I'm using Yanfly's Weapon Unleash and I want to use the replace attack function but only when the player has a specific state and weapon. I think this is doable by using lunatic mode, the example included is

<Custom Replace Attack>
if (user.level > 50) {
id = 50;
} else {
id = 0;
}
</Custom Replace Attack>

but I don't know enough java script for it to check for a state instead of level.
try:
Code:
user.isStateAffected(50)
to check if user inflicted with state 50... change 50 to the state id you want...

hope this help.
try:
Code:
user.isStateAffected(50)
to check if user inflicted with state 50... change 50 to the state id you want...

hope this help.
Yes, that worked. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/multiple-conditions-for-yep-weapon-unleash.137163/