as a note, you could simplify all of that post turn end notetag into
Code:
const states = target.states();
if ([8,23,24,25,27,28,29,47,48,55,57].some(s => states.includes(s))){
target.addState(133);
}
It may be possible that theres an issue causing states to be counted as active multiple times or for those notetags to be running multiple times. Id imagine you'd start seeing performance drops once you got past 100, not 5. 5 shouldnt be any issue
as a quick test, use this version of the post damage notetag, press f8 when the battle test is happening, go to the console tab, get the enemy their 5 states, and hit them.
Code:
if (Math.random() <= .04) {
target.addState(129)
}
console.log(target.states().length)
does the number it says sound correct for the amount of states the enemy has, and does it only output it once per hit?
Yeah, seems to output the correct amount of states and only does so once per hit.
I was closely examining the fight a few times and noticed that the lag seemed random.
However it seemed to occur the most when using skills and attacks that are multihit.
It especially seems to happen the most when using the default dual wield attack: the VisuStella Battle Core changes how dual wielding works and now attacks two separate times while dual wielding weapons. I'm not sure if that's the issue, since other multihit attack trigger this lag as well, but sometimes it doesn't lag from these either so at this point I just have zero clue what could be causing this.
EDIT: after doing a few more tests, it really does seem to always lag using the normal dual wield attack, and only sometimes lag with other multi-hit attacks. It even lags a tiny bit when attacking something that has no post damage notetags, however using post damage notetags seems to aggravate the lag. Attacks that target "x random enemies" don't seem to lag, but attacks that specifically use "repeat: x" will (sometimes, still inconsistent).