a way to up a Variable by 1 each turn in Battle?

I give up. I tried to find so many ways that just don´t work or I´m not doing it right like~
this thing google spat out to put on a state:

<JS Turn End Effect>
$gameVariables.setValue(51, $gameVariables.value(?) + 1);
</JS Turn End Effect>

Basicly I would like to make a piece of Armor/Accessoire that Ups a Variable by 1 each turn in battle, without falling back to "Troop Events" coz I have a few already and it starts to make my Game lag...
1778015186454.png

Would be very great if someone had an Idea on how to takle this and thanks in advance :>
<JS Turn End Effect>
did you check the documentation for the VS plugins that youre using to make sure thats a valid notetag? I cant see it in either the battle core or the skills and states plugin. It looks a guess based on Yanfly's notetag in MV and VS JS tags starting with JS, but I havent checked any plugins past those 2 mentioned.

$gameVariables.setValue(51, $gameVariables.value(?) + 1);
and you did have "51" where you have the "?", right?

I've moved this thread to Javascript/Plugin Support. Thank you.

First of: Thanks for considering to put some brain juice into this.
Some backstory:
I have a Skill that is an Avalanche in theme. That Skill repeats it self again with the use of "earth tokens". (as more rocks means more Avalanche). The Actor has a lot of skills that after use give him "earth tokens" to boost the skill. In reality the Earth Tokens are the Variable 51.

The Problem:
I had the great idea to add a piece of armor that passively, every turn, Ups the Variable by 1.
But no success in making it.

The solution:
The most promessing thing i could try was what google spat out~

which i just now fund in the RPG MZ script call Library as Add to variable
$gameVariables.setValue(variableId,
$gameVariables.value(variableId) + value);

But as i have no knowledge of JS Script, i don´t know how to use it or where to put it.
My first guess was to put it in the Notes.
and Yes i´ve put a 51 where the ? was. I also tried it as a state that is given passivly by wereing the Armor or geting the state via using a skill. Since using <Passive State: xxx> sometimes does not work.

And sorry for the long text. I feel like I´m realy bad at discribing what my problem is~
But as i have no knowledge of JS Script, i don´t know how to use it or where to put it.
My first guess was to put it in the Notes.
and Yes i´ve put a 51 where the ? was. I also tried it as a state that is given passivly by wereing the Armor or geting the state via using a skill. Since using <Passive State: xxx> sometimes does not work.
are you using a plugin that features the notetags that youre using? a notetag by itself doesnt do anything. the script call would be correct, but without plugins to introduce passive states and end-of-turn evals, its not going to be ran at any time.
I dont actually know tbh. These re the Plugins I´m using atm
1778176336949.png
There is a way because the game tracks it.
I dont actually know tbh. These re the Plugins I´m using atm
again, you need to check the documentation for the plugins youre using. Especially if youre unsure if its correct. the VS Battle Core already has state notetags for running code at the end of the turn that isnt what you shared.
1778179624387.png
Yeah, all i did was ask google "RPG MZ Up a variable by one each turn in battle passivly" or something and got the JS code from the first post 😅 which obviously did not work so I was wandering if there is a way of making the Idea work without using Troop Events. I mean ~ i tried to reserch how google thought it could work and tried to figure out if that it was even a thing but it is too far out of my wheelhouse so i posted a thread in here if someone with exp. had a quick idea how to make the Idea work.

EDIT: I mean there are a lot of great tutorials and examples here (like "how-to-implement-every-possible-yanfly-tips-tricks-effect-in-mz-with-visustella") that got me wondering if i could do it with JS code but as i don´t have the knowledge, all i could try was find something adjacent -> rewrite it for my purpose and be happy with the result and what i learned from it... Buuuuut i found no such thing... exept the "$gameVariables.setValue(variableId, value);" from a script calls library google doc and the knowledge something like <JS Post-Damage> </JS Post-Damage> exists.
again, you need to check the documentation for the plugins youre using. Especially if youre unsure if its correct. the VS Battle Core already has state notetags for running code at the end of the turn that isnt what you shared.
View attachment 365815
I read this again and just noticed it is called JS Pre-End Turn and not JS Turn End Effect ( >---<)7
... It works. I have no words for the emotion of anguish and relief right now. THANK YOU <3
reading nowadays are hard....

but reading carefully or check demo (if exist) is finding the key of your mistake ^^
I´m also Dyslexic.

Original thread: https://forums.rpgmakerweb.com/threads/a-way-to-up-a-variable-by-1-each-turn-in-battle.183501/