Problem with extending Buffs/Debuffs

Hi everyone.

So I've been using Visustella's plugins for my game. And I'm trying to create a skill that extends all debuffs currently applied to the target. Unfortunately though, every time I test things the game crashes when I use the skill. Can't seem to figure out why, though that's probably because I'm not at all versed with Javascript.

Screenshot 2024-08-05 171034.png
Screenshot 2024-08-05 171236.png

Screenshot 2024-08-05 171252.png


Strangely enough another skill with similar tags works fine on States, so my initial workaround was to change the buffs and debuffs to States. I want them to work like regular buffs/debuffs, where if a "buff" is applied to a upon a "debuffed" target (or vice-versa) it removes the "debuff" instead of applying the "buff", but I can't seem to get it to work, skills just keep both the buff and debuff on the target.

Screenshot 2024-08-05 171154.png
Screenshot 2024-08-05 171132.png


Could someone please help me fix either method so at least one works? If I haven't supplied enough information, I can provide more.
It looks like you're using the notetags correctly - it's not really possible to help you debug anything in a VisuStella plugin because the code is obfuscated. You'd have to follow the steps on their itch page to submit a bug report.

It's hard to help you with the second question, about states, because you've cropped your screenshots down and we can't see the IDs of the states you're putting the notetags in.

It doesn't look like the notetags would work because you haven't correctly formatted the closing tag. It needs to be </JS On Add State> with no space after the word "State".
Welp, taking the space out after the State fixed the second method. I do feel a bit stupid after missing something as simple as that though.

I guess I'll go submit a bug report to Visustella. But as long as what I have works, I'm happy.

Thanks for the fix.
for the first, you could try doing it in a more manual way with the js skill notetags.
try this
Code:
<JS Post-Apply>
for (var i = 2; i < 7; i++)
  if (target._buffs[i] < 0)
    target._buffTurns[i] += 3;
</JS Post-Apply>

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-extending-buffs-debuffs.170868/