MZ VisuStella AutoSkillTrigger

Hello, having an issue with the plugin in title. When one of these skills are triggered, such as when attacked, the target seems to just default to index 0, attacking the first enemy in the troop (or at best, a random enemy, if the skill is set to random targets). Is there any way to make it so that the target becomes the last enemy that attacked them? For example just having a simple counter attack type skill.
Use BattleCore target notetag. Actually google gives you a quick result:

<JS Targets>
// Clears all targets
targets = [];
// Get the index of the last enemy to attack
let eIndex = $gameTemp._lastActionData[3] - 1;
// Adds the enemy that acted last to the pool of available targets
targets.push($gameTroop.members()[eIndex]);
</JS Targets>
Fantastic, this seems to work. Thank you.
Tried googling it, but I couldn't find the solution anywhere.

Original thread: https://forums.rpgmakerweb.com/threads/visustella-autoskilltrigger.176918/