YEP Item Durability Specific Skills only affect Specific Weapons

Yanfly Item Durability has the ability to universally affect all weapons when setting the durability lost through physical or magical actions. However, I would like to have a specific weapon type to lose durability when using magical actions.

For example. Using magical attacks when using sword does not affect the durability, but using magical attacks when using staves does affect the durability.

I tried using a few evals in the Magical Action Parameter:
if ($gameActors.actor(this.actorId()).isWtypeEquipped(2) === true) { -1; }

if ($gameActors.actor(this.actorId()).isWtypeEquipped(2) === true) { -1; if (this.actorId().equips()[0].durability <= 0) {this.actorId().durabilityBreakItem(this.actorId().equips()[0]);} }

if ($gameActors.actor(this.actorId()).isWtypeEquipped(2) === true) { return -1; }

However, all of these turns the weapon in question into unbreakable equipment, rather than lowering it.
Are there any issues with the eval, or an alternative way to do this?
I don't think evals work in the plugin parameters. This might need to be done through notetags. Each skill will need to address each weapon type to determine durability changes.
Whenever I try to do this with Yanfly Skill core an 'undefined is not a function' error.

This is the note I used for the skill.

<After Eval>
if ($gameActors.actor(this.actorId()).isWtypeEquipped(2) === true)
{
$gameActors.actor(this.actorId()).equips()[0].durability -= 1;
}
</After Eval>

Edit: I found part of the issue. Defining an actor with $gameActors.actor() works, the 'undefined' is probably from the 'this actor id' statement. However, I still need a way to make sure the actor casting the skill is called.
Try this:

<After Eval>
if (user.equips()[0].wtypeId === 2)
{
user.equips()[0].durability -= 1;
}
</After Eval>
Apparently, I've been making it more contrived than it needed to be. This works great, but an unintended consequence came up, the skill will break unbreakable weapons.
Is there a way to check this before removing the durability?
Edit: NM, I'll just make sure these are not listed as the WType. This can be closed.
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/yep-item-durability-specific-skills-only-affect-specific-weapons.103795/