So I'm trying to replicate the black hood effect from Final Fantasy 15 which automatically dodges an attack, but in turn uses some MP. I got it working, but the only problem is the miss tag will show 3 times instead of once, and I'm not sure how to prevent this from happening.
JavaScript:
<Custom React Effect>
if (Math.random() < 1) {
target.result().evaded = true;
var mpCost = 20;
if (target.mp >= mpCost) {
target.gainMp(-mpCost);
} else {
target.removeState(141);
}
}
</Custom React Effect>