MV Detect Skill Type of Incoming attack?

Hi, apologies if this question has been posed elsewhere; I can't find an answer to this anywhere.

Currently, I am using the following as a small plugin for a 'Cover' skill.
JavaScript:
BattleManager.checkSubstitute = function(target) {
    return !this._action.isCertainHit();

};

(via: https://forums.rpgmakerweb.com/index.php?threads/cover-ally-skill.84139/post-776362 )

Which works fine, but I am looking for a way to determine whether the incoming skill is magical or not, and set the cover condition to false if so. The goal is to make this Cover skill only protect against physical attacks.

In my notes, I think I've already figured out how to make the Cover Condition set to false if an ally is casting a spell on themselves/another ally? Though maybe it's just placebo haha
JavaScript:
<cover condition>
if (a._actorId){
false}
else{
true
}
</cover condition>

So I'm wondering if what I'm looking to do could be done in a similar way.

(Also; sorry if this in the wrong section. I am fairly new to this scene.)
The goal is to make this Cover skill only protect against physical attacks.
Code:
    return this._action.isPhysical() && !this._action.isCertainHit();
Code:
    return this._action.isPhysical() && !this._action.isCertainHit();
That worked like a charm!
Seems like an obvious fix looking at it now. Would the same be true of the reverse? ie; return this._action.isMagical() for something that responds exclusively to magic?
Right. You should also be able to find these in the pinned thread of MV common script calls.
Right. You should also be able to find these in the pinned thread of MV common script calls.
Perfect, thank you. I will have a look around!

Original thread: https://forums.rpgmakerweb.com/threads/detect-skill-type-of-incoming-attack.155198/