Can you run a plugin command within a State notetag?

I want an animation to run within a state whenever the user inflicted with the state deals damage to an enemy. I'm using the VisuStella BattleCore command "INJECT: Animation Begin". This does work inside the Common Event of a skill, and other commands inside the <JS Post-Damage as User> notetag of the state also work. It's only the plugin command which has a problem. No errors are returned, it just does nothing. Here's the code of interest:

Code:
<JS Post-Damage as User>
PluginManager.callCommand(this, "VisuMZ_1_BattleCore", "INJECT: Animation Begin", {
  Targets: ["user"],
  Filename: "Shock",
  HorizontalCells: "4",
  VerticalCells: "1",
  FrameDelay: "30",
  SmoothBitmap: "false",
  Offset: "",
  OffsetX: "+0",
  OffsetY: "+0"
});
</JS Post-Damage as User>

I've tried all combinations of
a) replacing this with $gameTroop._interpreter
b) replacing Targets: ["user"] with ["target"], ["current target"], even ["actor id 4"]
c) replacing "INJECT: Animation Begin" with "ActSeq_Inject_AnimationStart"

I've even tried other, simpler plugin commands with no luck.

Code:
PluginManager.callCommand(this, "VisuMZ_1_BattleCore", "ANIM: Show Animation", {
  Targets: ["user"],
  AnimationID: "65"
});

Edit: @rpgLord69 provided the correct answer:

Code:
PluginManager.callCommand(this, "VisuMZ_1_BattleCore", "ActSeq_Inject_AnimationStart", {
 "Targets:arraystr" : JSON.stringify(["user"]),
 "Filename:str" : "Shock",
 "horzCells:num" : 4,
 "vertCells:num" : 1,
 "frameDelay:num" : 30,
 "smooth:eval" : false,
 "Offset" : 0,
 "offsetX:eval" : +0,
 "offsetY:eval" : +0
});

I didn't even think to look in the Battle Core plugin for the command name; I assumed the code was obfuscated. I was using the Battle Core wiki as my reference and it never mentions ActSeq_Inject_AnimationStart. Also, I'm enough of a JavaScript newb that
"Targets:arraystr" : JSON.stringify(["user"]),
was dark magic.
"INJECT: Animation Begin" is the human-friendly name of the plugin command. You get the "technical" name by reading the plugin (the readable part, not the obfuscated).

1753177879252.png


This is what you need to enter.
@Aerosys That's the command for showing an animation, I think. They need the inject command.

Anyway, I'm no expert with the syntax, but compared to how I've made the plugin commands run, you have multiple problems (in addition to the command name). This is how I've used to writing it, I tested it and it seemed to work for me:

PluginManager.callCommand(this, "VisuMZ_1_BattleCore", "ActSeq_Inject_AnimationStart", {
"Targets:arraystr" : JSON.stringify(["user"]),
"Filename:str" : "Actor1_6",
"horzCells:num" : 4,
"vertCells:num" : 1,
"frameDelay:num" : 30,
"smooth:eval" : false,
"Offset" : 0,
"offsetX:eval" : +0,
"offsetY:eval" : +0
});
oh this is actually very usful to know, thank you!
@Aerosys That's the command for showing an animation, I think. They need the inject command.
Ah yes, I Ctrl+F'd the wrong one. But the way to get there is clear, I think 🙂
@Aerosys That's the command for showing an animation, I think. They need the inject command.

Anyway, I'm no expert with the syntax, but compared to how I've made the plugin commands run, you have multiple problems (in addition to the command name). This is how I've used to writing it, I tested it and it seemed to work for me:

PluginManager.callCommand(this, "VisuMZ_1_BattleCore", "ActSeq_Inject_AnimationStart", {
"Targets:arraystr" : JSON.stringify(["user"]),
"Filename:str" : "Actor1_6",
"horzCells:num" : 4,
"vertCells:num" : 1,
"frameDelay:num" : 30,
"smooth:eval" : false,
"Offset" : 0,
"offsetX:eval" : +0,
"offsetY:eval" : +0
});
Thanks! This worked perfectly.

Original thread: https://forums.rpgmakerweb.com/threads/can-you-run-a-plugin-command-within-a-state-notetag.179080/