MV Help! - Hide unusable skills using 3 conditionals

Hello, I'm using yanfly's Class Change Core/Sub Class/ Skill Core/ Equip Core. Since the class change plugin shows every spell from every available class, I decided to hide every spell unless the character is using an specific class/item.

In my game, the main class determines the base character attributes (like defensive, magical, balanced, etc.) while the subclass determines the tipe of magic the character can use (like fire spells, healing spells, etc.). Aside from it, the characters can equipe certain equips to gain access to other spells (like a fire materia ish). Every class/equips are available to all characters, it's up to the player to decide each character role in battle.

The problem is that I can't create an custom script (lunatic mode) to make it work. After more than 5 hours of research I could came up to 3 possible solutions but none of them work:


<Custom Show Eval>

if (user._classId == 5) {
visible = true ;
} else if (user._equips[10]._itemId == 111) {
visible = true;
} else if (user._equips[11]._itemId == 111) {
visible = true ;
} else {
visible = false;
</Custom Show Eval>


<Custom Show Eval>

if (this._classId === 5 ||
user._equips[10]._itemId == 111 ||
user._equips[11]._itemId == 111) {
visible = true;
} else {
visible = false;
}
</Custom Show Eval>


<Custom Show Eval>
visible = (this._classId === 5 || user._equips[10]._itemId == 111 || user._equips[11]._itemId == 111)
</Custom Show Eval>

I tried adding and removing parentheses but it wont work.
I got zero knowledge regarding programming, this the best I can do.

I was able to make it work using a single condition (like class id only), but I can't make it work with multiple ones.
you could try different approach. each class has different skill type but the types all just have the same name. this way when fire mage learns a skill it doesnt show up in different classes skill list.
then the equipment based skills just make duplicates for each skill type.
The main problem with that is that I hate the idea of having different menus for different skill types. I really wish I could group them together. I tried different tags and I noticed that my class/subclass plugins tags are not working at all (I did turn every plugin off aside from the ones mentioned.). I will start another thread to find a solution to this problem. In the mean time, I will use multiple skill types. Thank you for your help!
Moved to: Plugin Support
Since you're using one Yanfly plugin, you're probably using multiple.

The easiest way to do this is to have the accessory, as well as the class grant a passive state, and then use the passive state as the condition for showing the skill.

Code:
<Custom Show Eval>
visible = user.isStateAffected(x)
</Custom Show Eval>

Then just put a tag for <Passive State: x> on the class, and accessory.
My brain just exploded! This is so much easier! Thank you so much!
yeah man, if you have yanfly plugins, passive states make a hell of a lot easier to check actors, enemies and other stuff.

i wonder when will it be that there are too many states to make the game hic-up...

Original thread: https://forums.rpgmakerweb.com/threads/help-hide-unusable-skills-using-3-conditionals.133042/