How to check if skill is being used in battle

Hello,

I am trying to check to see if battler is using a certain skill so that a certain condition triggers. I thought the script call was user.currentAction().item(0.id === x, with x being the skill ID. However whenever I use this i get the error code saying "item is undefined. "

for more clarification here is an example of what I mean.

<Custom Confirm Effect>
if (this.isSkill() && user.currentAction().item().id === 1) {
user.gainHp(500);
}
</Custom Confirm Effect>
I have been using this to make it work:
Code:
var skills = [];
skills.push(a,b,c,b); //change a b c d to your skill ID, or just use one of them
if (this.isSkill() && skills.contains(this.item().id)){
//do something
}
Thanks for the reply,

I tried the code and although I do not get an error, doesn't seem as if the the statement is being applied don't see anything occuring.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-check-if-skill-is-being-used-in-battle.97255/