MZ Visustella Action Sequences Break $target in <JS Post-Damage>

Greetings,

Got a question for yall.

I am encountering a bug with the battle core and how action sequences interact with <JS Post-Damage>. Any skill that uses targeting within an action sequence (in the common event) will break all uses of $target in <JS Post-Damage> in other skills. To elaborate, if I have a skill that uses any form of targeting in an action seqeuence (using Mech: Action Effect), any skill I use with <JS Post-Damage> will not recognize proper targets for $target.

For example, the following code will not function in a skill if I previously used a skill that had a custom action sequence at any point in the battle: (to clarify, there is no crash, the targets will either be no one or it will always target the 1st actor in the battle to remove a state, regardless of the actor targeted by the skill)

<JS Post-Damage>

Code:
if ($target.isStateAffected(72)) { 
  $target.removeState(72) 
$target.addState(73)};

</JS Post-Damage>

However, the above code works perfectly fine if I do not use any skills that contain any action sequence that uses any form of targeting.

So my question is, has anyone encountered similar targeting bugs in the Battle Core and how it interacts with <JS Post-Damage> and know what to do about it?
have you tried just using target in the <JS Post-Damage> notetags? im not familiar with VS AS at all, but i was under the impression that $target was just how you access the target from the common event, and you could still use target within the skill notetags.
have you tried just using target in the <JS Post-Damage> notetags? im not familiar with VS AS at all, but i was under the impression that $target was just how you access the target from the common event, and you could still use target within the skill notetags.
Thank you for the reply!

I can indeed use $target in <JS Post-Damage> within skill notetags, and it works fine if I don't use any action sequences in any skills whatsoever during a battle.

The issue becomes that I cannot use both at the same time because of $target breaking whenever an action sequence fires in a battle. And unfortunately I need action sequences since it's what I primarily use to create quality visual effects in battles. So I'm kind of between a rock and a hard place where these two aspects of the Visustella Battle Core don't want to play nice with each other and I'm not sure what to do about it.
I can indeed use $target in <JS Post-Damage> within skill notetags
just to clarify, i didnt mean using $target in the <JS Post-Damage> notetag. i mean just using target. no $.
its a valid variable provided within that notetag normally, so i want to make sure that using target within the notetag and $target within the common event is fine or not.
As Robro33 mentioned:

The 'target' variable represents the one receiving the skill/item hit.

So, I guess Visu recommneds using "target" in JS notetags.
Usually I use "$target" and "$subject" in AC and use "target" and "user" in JS notetags.

How about just including the code in your AC? Is there any reason it has to be in the JS notetag?
Or you can use another notetag but Post-Damage.
As Robro33 mentioned:

The 'target' variable represents the one receiving the skill/item hit.

So, I guess Visu recommneds using "target" in JS notetags.
Usually I use "$target" and "$subject" in AC and use "target" and "user" in JS notetags.

How about just including the code in your AC? Is there any reason it has to be in the JS notetag?
Or you can use another notetag but Post-Damage.
I couldn't get it to quite work right in the action sequence if that's what you mean by AC. The reason is I haven't been able to figure out how to NOT remove a state when a skill is avoided within an action sequence. Using <JS Post-Damage> let me do that easily, just ran into the issue of $target not functioning when other skills with action sequences were used.

I talked to some peeps on the discord though and as @Robro33 and you said, they told me to try target with no $ and see how that works. I did a little testing and it seemed to potentially have fixed the issue! I will do more testing to make sure, but it looks like that may be what's going on.

It may simply be that I need to use target in <JS Post-Damage> as for some reason $target in <JS Post-Damage> and action sequences don't mix well. Honestly didn't realize I could just use target with no $ to begin with.

I'll post here tomorrow if this does indeed fix the issue. Thank you both for the assistance, I appreciate it alot 🙂.
Just wanted to post an update here that the issue has been resolved.

It was indeed because I was using $target. I need to be using target in <JS Post-Damage> to properly apply the effect to the target of the skill. $target indicates the last recorded target and not the current target, which was resulting in funky behavior when combined with action sequences that were targeting things.

Thank you all very much for the assistance and have a wonderful weekend 🙂.

-Niniann
This thread is closed due to being reported as solved. If you need it reopened, report it to let us know. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/visustella-action-sequences-break-target-in-js-post-damage.174908/