MV YEP_SkillCore Blue Magic Assistance

I am trying to remove the class-specific portion of Yanfly's tips-and-tricks blue magic script utilizing the SkillCore plugin:


The original script:
JavaScript:
<Post-Damage Eval>
if (target.isActor() && target._classId === 20) {
  if (!target.isLearnedSkill(item.id)) {
    target.learnSkill(item.id);
    var text = target.name() + ' has learned '
    text = text + item.name + '!';
    $gameMessage.add(text);
  }
}
</Post-Damage Eval>

My blue magic (skill type) is enabled via a passive state, so I do not want it to be class-specific. The script I edited is not working:
JavaScript:
<Post-Damage Eval>
if (target.isActor() {
  if (!target.isLearnedSkill(item.id)) {
    target.learnSkill(item.id);
    var text = target.name() + ' has learned '
    text = text + item.name + '!';
    $gameMessage.add(text);
  }
}
</Post-Damage Eval>

By not working, I mean an actor with the blue magic capability cannot learn an enemy skill that has the script embedded in notes. I can provide screenshots if needed, but just need the script checked. Thank you.
Code:
<Post-Damage Eval>
if (target.isActor() && target.isStateAffected(x)) {
  if (!target.isLearnedSkill(item.id)) {
    target.learnSkill(item.id);
    var text = target.name() + ' has learned '
    text = text + item.name + '!';
    $gameMessage.add(text);
  }
}
</Post-Damage Eval>

X = your Blue Magic passive state.
Solved. Thank you!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/yep_skillcore-blue-magic-assistance.153541/