Yanfly's Libra Skill and making enemies immune to it

I use Yanfly's Libra skill (which requires Yanfly's Skill Core plugin) in my project as a way for the player to examine enemy status and reveal their HP gauges. However, I would like for bosses to be immune to this skill. My solution was to create a Libra Immune state and have it applied passively to bosses and then have the skill itself check for the state when the player attempts to use Libra.

The Lunatic Mode notetag for the Libra skill is a Before Eval tag and it starts by checking if the target is an enemy. I believe I can simply add another condition to it to check if the target is both an enemy AND not affected by the Libra Immune state. I don't really understand Javascript that well but the tag starts with:

if (target.isEnemy()) {

I think I can add something like "&& isStateAffected" or something like that but I'm not sure. The idea is that it will check if the enemy has the Libra Immune state, and if they do (such as a boss), then nothing happens. Any ideas?
Try:
if (target.isEnemy() && !target.isStateAffected(X)) {
Where "X" is your state ID for the libra immunity.

Adding a "!" before the condition is essentially saying "is not" - so if the target is NOT affected by state X, then libra works, otherwise, it's a no go.
Try:

Where "X" is your state ID for the libra immunity.

Adding a "!" before the condition is essentially saying "is not" - so if the target is NOT affected by state X, then libra works, otherwise, it's a no go.

Worked like a charm! Thanks a lot!

Original thread: https://forums.rpgmakerweb.com/threads/yanflys-libra-skill-and-making-enemies-immune-to-it.107127/