Yanfly weapon unleash: replace the attack depending on a switch

Hi! I'm using Yanfly Weapon Unleash plugin to replace the basic attack skill of my characters.

I'd like to have a different skill shown in the place of attack depending on a switch.

I have tried the following code as a notetag for a class:

<Custom Replace Attack>
if $gameSwitches.value[1013] == true {
id = 92;
} else {
id = 61;
}
</Custom Replace Attack>

Aaaaaand congratulations, I made the game crash.

Could anyone help me fix my code? In case it's not understandable, I'm trying to show skill 61 in the place of attack if the switch 1013 is off, and show skill 92 if switch 1013 if on.

Thanks in advance!
Code:
<Custom Replace Attack>
if ($gameSwitches.value(1013) == true) {
id = 92;
} else {
id = 61;
}
</Custom Replace Attack>

Should look like this.

Tested and it worked fine. If you have more issues, press F8 to open to console and post your error log.
It works like a charm 🙂

Thank you so much for your help!
im having some issues with this same plugin... i dont know why it aint working. i have items giving states and depending on the state, the attack replacement. heres the code:

JavaScript:
<Custom Replace Attack>
   if(user.isStateAffected(19)){id = 0;}
   else if(user.isStateAffected(20)){id = 0;}
   else if(user.isStateAffected(21)){
      if(user.isStateAffected(16)){id = 4;}
      else if(user.isStateAffected(17)){id = 5;}
      else if(user.isStateAffected(18)){id = 6;}
      else{id = 3;}
   }
   else{
      if(user.isStateAffected(16)){id = 4;}
      else if(user.isStateAffected(17)){id = 5;}
      else if(user.isStateAffected(18)){id = 6;}
      else{id = 0;}
   }
</Custom Replace Attack>

the repeated ids (final scope) are just for testing purposes as the skills above 10 arent ready yet. even though the test actor has states 16 and 21, nothing happens. i even tried to force the skill 1 (attack) to happen replacing the zeroes in the checks. no success.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-weapon-unleash-replace-the-attack-depending-on-a-switch.120866/