Auto Passive States JavaScript code

Hi, i need help whit some code. I'm using YEP.13 – Auto Passive States, i need help white same JavaScript code. I'm using this code only be active if the player is using a sword.
Spoiler: Types
Auto Passive States.jpg
Code:
<Custom Passive Condition>
if (user.hasSkill(648)) {
condition = false;
} else {
var weapons = user.weapons();
var arma = 2;
condition = false;
for (var i = 0; i < weapons.length; ++i) {
  var weapon = weapons[i];
  if (weapon && weapon.wtypeId === arma) {
    condition = true;
    break;
  }
}
}
</Custom Passive Condition>

What i need is remake the same code but for Armor Types, for the number 6 to be more specific.
Spoiler: Types2
Auto Passive States2.jpg
Up
Substitute all weapons by armors, arma 2 for arma 6 and wTypeId for aTypeId and you are set.
I think i made a mistake 🙂 i got a error on console.
Auto Passive States JavaScript code3.png


I have the weapons whit the same passive state and only the new code is generating this error
That is because you did not substitute everything properly. Place the two codes next to each other and substitute everything properly, keeping singular and plural where they need to be.
Ok i will tray, i did not change the weapon

if (weapon && weapon.wtypeId === arma)

I only change Wtypeld

if (weapon && weapon.aTypeId === arma)

This mas be the error :9 im going to give it a tray, thanks
And you also, in one place, typed armors instead of armor.
That is perfect. Thanks 🙂

Original thread: https://forums.rpgmakerweb.com/threads/auto-passive-states-javascript-code.94360/