Making a skill require non-weapons to use?

So as part of my game I'm using a system where two of the three classes require certain weapons to use their skills. It should be no problem for rogues who wield daggers and bows, or warriors wielding two-handed weapons.

However, the remainder are my weapon and shield warriors, who require both a one-handed weapon and a shield to use their skills. Setting their skills to require a one-handed weapon is easy, however I want to cover a scenario where they don't wield a shield, or are dual wielding and logically won't be able to use a shield.

Here's my attempt using Yanfly's Skill Core to check if the user is wielding a shield:

JavaScript:
<Custom Requirement>
//check if user is actor
if (user.isActor()){
   // check if has shield equipped
   var armors = user.armors();
   var shield = armors[1];
   if (shield !== 0) {
     value = true;
   } else {
     value = false;
   }
} else{
  value = true;
}
</Custom Requirement>

Will that code do, or is there a better way to do it?
value = user.armors().some(armor => armor.etypeId === 2)
Will the same code work in a state if I insert it as a passive condition (replacing value with condition)?

Original thread: https://forums.rpgmakerweb.com/threads/making-a-skill-require-non-weapons-to-use.136762/