MZ Using a notetag inside a Javascript Notetag?

Hello!

Preface: Using an assortment of Visustella Plugins, current one's mentioned are Auto-Skill Triggers, Limited Skill Uses, STB Battle System, and Battle Core.

Currently, I made a skill that activates upon taking an attack, or multiattacks (I can't tell, the gfx is blinding), but now I'm trying to make it so that it can only be used 3 times, after which, it needs to cycle back to her turn, and she regains those uses again.

Originally, I started out with cooking up an idea with BattleManager.actor()._actorId.isInputting, but eventually, I found a JS notetag and a method that's even easier, <JS Pre-Start Turn>, which is just BattleManager.startTurn() in disguise, but now I'm stuck, because I can't use a notetag inside a JS notetag, or just plain JS (that I couldn't find out through google)

The way the skill works is:

Use Skill to give Counter Stance for 3 turns -> Stance gives Counter Skill -> Counter Skill Activates -> (Hopefully, limited skill uses by 3) -> Check if stance is active. If so, refresh skill uses when next turn starts.

Using the skill to give stance also refreshes skill uses by notetag as well.

(Skill 68 is my counter skill)
<JS Pre-Start Turn>
<User Skill 68 Uses: +3>
</JS Pre-Start Turn>


Is there some equivalent to this, where I can just refresh the skill at the start of the turn? (Also, does BattleManager.startTurn() and <JS Pre-Start Turn> work on STB Battle System?)
Is there some equivalent to this, where I can just refresh the skill at the start of the turn
what youd do is find whatever function the <user skill x uses> tag calls and use that inside of the <js pre-start turn> notetag instead. I dont own the plugin and the website doesnt list it, so i cant just tell you, but if you poke around the console you may be able figure it out
what youd do is find whatever function the <user skill x uses> tag calls and use that inside of the <js pre-start turn> notetag instead. I dont own the plugin and the website doesnt list it, so i cant just tell you, but if you poke around the console you may be able figure it out
Ironically, I poked around and found out. Though I wouldn't recommend it, since it's VisuStella and it's messy. Also, I don't know if it's against ToS to share what I found and I'd rather not risk it.

Essentially, I found a variable that controls directly, the amount of limited skill uses I have.
Then just applied it to each actor that has that skill id.

$gameActors.actor(-actor id-)._skillLimitedUseTimes[skill id] = 0

But now to figure out how to get the current active actor id (and if I can do this pre-turn or using another Javascript Notetag)
But now to figure out how to get the current active actor id
There's no need to be using IDs or going through $gameActors at all.

From the description of the notetag you're using:

1726377440766.png

1726377450653.png


So user._skillLimitedUseTimes etc.
$gameActors.actor(-actor id-)._skillLimitedUseTimes[skill id] = 0
i recommend looking to see if theres a function that sets it instead of altering its value directly. there may be other parts of the process and safeguards that would be akipped by changing the value directly.

other than that...
But now to figure out how to get the current active actor id (and if I can do this pre-turn or using another Javascript Notetag)
that shouldnt be necessary. if you use the <js pre-start turn tag>, you probably already have a usable reference to the battler with the state active. no need to fish for IDs. just use
Code:
user._skillLimitedUseTimes[skill id] = 0
There's no need to be using IDs or going through $gameActors at all.

From the description of the notetag you're using:

View attachment 317815
View attachment 317816

So user._skillLimitedUseTimes etc.
i recommend looking to see if theres a function that sets it instead of altering its value directly. there may be other parts of the process and safeguards that would be akipped by changing the value directly.

other than that...

that shouldnt be necessary. if you use the <js pre-start turn tag>, you probably already have a usable reference to the battler with the state active. no need to fish for IDs. just use
Code:
user._skillLimitedUseTimes[skill id] = 0
It seems my ability to read documentations is faulty. I did not notice that section.

And in reference to safeguards, I found the function in question responsible for checking it.
It mostly checks for out of bounds errors, uninitialized values, and also takes in input (since it's a notetag function), but just because it could be safer, I replaced it with this:

user.setSkillLimitedUseTimes(skill id, 0) where the 0 is the number of times the skill has been used (It resets the number of limited skill uses)

Bonus points: It does exactly what we all did.

this._skillLimitedUseTimes[skill id] = useCount


Thank you both for the assistance. Don't know what the method for closing a forum post is, so-
Mods!

Original thread: https://forums.rpgmakerweb.com/threads/using-a-notetag-inside-a-javascript-notetag.171909/