Trying to make a Quest for Glory "Zap" skill...

I've modified Yanfly's Statikk Shiv state thing because I want to try my hand at a Quest for Glory Zap skill.


http://questforglory.wikia.com/wiki/Zap


http://yanfly.moe/2016/05/18/tips-tricks-statikk-shiv-league-of-legends-rpg-maker-mv/


After several test runs, I've finally gotten it to work without giving me a SyntaxError... but it's not doing any damage. No damage popup, no animation plays, and the game acts like nothing happened at all. In fact, the only time I DO see an animation play is when it's the standard animation I have for the Staff I have equipped... and that's only playing when I miss.


Here's my code:

<Custom Regenerate Effect>


user.addStateCounter(stateId, 1);


user.clampStateCounter(stateId, 0, 1);


</Custom Regenerate Effect>


<Custom Confirm Effect>


if (this.isAttack() && target.isActor() !== user.isActor()) {


user.clampStateCounter(stateId, 0, 1);


user.removeStateCounter(stateId);


var elementId = 5;


var damage = user.mat * 2;


if (target.result().critical) {


damage = this.applyCritical(damage);


}


target.startAnimation(77);


if (member) {


member.startAnimation(77);


member.gainHp(-Math.ceil(damage * member.elementRate(elementId)));


member.startDamagePopup();


if (member.isDead()) {


member.performCollapse();


}


}


}


</Custom Confirm Effect>

Anyone got any ideas?


EDIT: Nevermind! Just turned all instances of member to target and it worked! Yay! I'm getting slightly better at JS!

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-make-a-quest-for-glory-zap-skill.62680/