MZ Include in the damage formula if the target is a specific actor?

Is this possible? Something like:

b.isActor(3)? a.mat*2 : a.mat;
isActor() only checks if the target in this case is an actor, that's it.
To get the target's actor id you can try this: b.actorId() == 3
By default b.actorId() will only work if the target is an actor. If the item in question can target enemies as well you could add a check for that:
b.isActor() && b.actorId() === 3

Alternatively you could also check the targets identity like this:
b === $gameActors.actor(3)
By default b.actorId() will only work if the target is an actor. If the item in question can target enemies as well you could add a check for that:
b.isActor() && b.actorId() === 3
We don't have to do this type of check in MZ, since we can use optional chaining:
JavaScript:
b.actorId?.() === 3
We don't have to do this type of check in MZ, since we can use optional chaining:
Because ES one billion!! 🤣

Original thread: https://forums.rpgmakerweb.com/threads/include-in-the-damage-formula-if-the-target-is-a-specific-actor.152076/