Reset CD + Extra turn if skill kills enemy

I've moved this thread to Plugin Support. Thank you.

@Icenick I was talking to @Lay the other day, and a possible but still untested way to make it not be instant anymore without this problem of the repeating action end effects could be to make it instant all the time but at the check if the enemy died, if they did not die you add the line "BattleManager._instantCasting = false" Not sure though, needs to test still.

And yes, you'd do
Code:
for (var s = 0; 0 > iceskills.length; s++) {
if (user.cooldown(iceskills[s]) > 0) user.setCooldown(iceskills[s], Math.max(user.cooldown(iceskills[s])-1,0));
}
your iceskills is an array of numbers, they have no .id, but have a list depending on the index of them.
@Icenick I was talking to @Lay the other day, and a possible but still untested way to make it not be instant anymore without this problem of the repeating action end effects could be to make it instant all the time but at the check if the enemy died, if they did not die you add the line "BattleManager._instantCasting = false" Not sure though, needs to test still.

And yes, you'd do
Code:
for (var s = 0; 0 > iceskills.length; s++) {
if (user.cooldown(iceskills[s]) > 0) user.setCooldown(iceskills[s], Math.max(user.cooldown(iceskills[s])-1,0));
}
your iceskills is an array of numbers, they have no .id, but have a list depending on the index of them.

Im sorry I have no idea where to put your line. Even don't know how to set it so it can only be used once per turn.
Code:
<Custom Establish Effect>
var iceskills = [76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99]
for (var s = 0; 0 > iceskills.length; s++)
    if (target && target.result().hpDamage > 0 && target.result().critical) {
if (user.cooldown(iceskills[s]) > 0){
user.setCooldown(iceskills[s], Math.max(user.cooldown(iceskills[s])-1,0));
  // Remove the icecdreset state from the target
  target.removeState(70);}
}
</Custom Establish Effect>

<Custom Remove Effect>
// Set the reseticeCooldown to 1 turns
user.reseticeCooldown = 1;
</Custom Remove Effect>

EDIT: I tried and it not work
Code:
<Instant>
<Post-Damage Eval>
if (target.hp > 0) {
BattleManager._instantCasting = false;
} else {
user.setCooldown(87, Math.max(user.cooldown(87)-7,0));
}
</Post-Damage Eval>

Original thread: https://forums.rpgmakerweb.com/threads/reset-cd-extra-turn-if-skill-kills-enemy.120625/