MZ Skills and/or weapons that cannot be countered

I'm using Visustella. Is it possible to give a tag to some skills and/or weapons so that they can never be countered even if the enemy has 100% CTR?
I think a plugin like this would work, use <noCounter> notetag on skills/weapons


const _myEdit1_BattleManager_invokeCounterAttack = BattleManager.invokeCounterAttack;

BattleManager.invokeCounterAttack = function(subject, target) {
if ($dataSkills[$gameTemp.lastActionData(0)].meta.noCounter || (subject.isActor() && subject.weapons()[0]?.meta.noCounter)) {

} else {
_myEdit1_BattleManager_invokeCounterAttack.call(this, subject, target);
}
};

EDIT: added a check to check if subject is actor before checking the weapons
Tried it a bit, it seems to me like it's working, thank you very much.

Original thread: https://forums.rpgmakerweb.com/threads/skills-and-or-weapons-that-cannot-be-countered.182422/