So I'm trying to make an attack that deals extra damage depending on how many states an enemy has on them, and to that end I wrote the following bit of code using Skill Core's <Before Eval> notetag:
However, this doesn't seem to have any effect at all when I hook variable 70 into the skill's damage formula as a multiplier. As far as I can tell from debugging, targetStates is never getting a value, but this doesn't make sense to me, as some of Yanfly's tutorials use this exact method. Can anyone tell me what I'm doing wrong here?
Code:
<Before Eval>
var commonStates = [4, 5, 6, 7, 8, 9, 10, 48];
var targetStates = target.states();
var damageMult = 1;
for (let a = 0; a < targetStates.length; a++) {
if commonStates.contains(targetStates[a]) {
damageMult += .25;
}
}
$gameVariables.setValue(70, damageMult);
</Before Eval>
However, this doesn't seem to have any effect at all when I hook variable 70 into the skill's damage formula as a multiplier. As far as I can tell from debugging, targetStates is never getting a value, but this doesn't make sense to me, as some of Yanfly's tutorials use this exact method. Can anyone tell me what I'm doing wrong here?