Ok here's the basic logic (no code):
1. You want to keep track of which actors have used the skill or not
2. You want to be able to use this information as part of your skill condition or something
3. You want to be able to reset this information, like when a new day begins, or you use an item or something.
First, you can have your skill call a common event and just let the common event handle all of the logic. But the problem is you don't know who used it.
You can use the damage formula to set a variable like this. So basically you're setting the variable 1 to the ACTOR ID. This is important: remember which variable you used to store your actor ID.
There's this plugin that basically let's you write effect formulas in a note-tag, which might make things cleaner, but up to you.
http://himeworks.com/2016/02/formula-effects-mv/ (note that it's an effect, not a damage formula. Effects occur after damage processing)
Note that the scope can't be NONE because otherwise by default the damage formula doesn't get applied when scope is NONE. I'm just using "user scope" to test it quickly.
Next, you have that common event that gets executed. You can test that it works and shows your actor ID
This is how you can connect skills to common events via scripts. Then your common event just needs to take that actor ID and do something with it.
A variable can store more than just numbers, if you're using script calls. You might store a javascript object instead. First, you make this script call to "initialize" your object:
Code:
// initialize variable object
var obj = $gameVariables.value(2)
if (obj === 0) {
obj = {}
$gameVariables.setValue(2, obj)
}
// initialize count for actor
var id = $gameVariables.value(1)
obj[id] = obj[id] || 0
Basically, give it a value of 0.
Then you make a conditional branch check.
Remember that variable 2 stores our custom object, and variable 1 was the actor id (based on the damage formula)
Code:
$gameVariables.value(2)[$gameVariables.value(1)] === 0
Then you increment the usage by 1 for that actor
Code:
// initialize variable object
var obj = $gameVariables.value(2)
obj[$gameVariables.value(1)] += 1
This how the full common event looks.
This is if you don't want to use ANY plugins to keep track of that skill usage. If you want to do a skill reset, then just make script call to re-initialize the object's values to 0. For example something quick and dirty like
Code:
$gameVariables.setValue(2, {})
Which basically wipes out all of the data, and next time you make the common event call, it will re-initialize it to 0 so that you can start using it again.
Video demo of results:
▶ Post on X (Twitter)