traits depending on enemy count?

Hi!

I was wondering if with yanfly's plugins there was a way to make an item that gives certain stats
if for example 3 or more enemies are facing you. Or make a piece of equipment that unleashes its full
potential when you face only 1 enemy?
Is there some sort of lunatic mode sorcery I can use to make this happen :> ?
There is some lunatic mode sorcery you can use. Namely it's

<Custom parameters>
if ($gameTroop._enemies.length == 4) {
atk = 30
}
</Custom parameters>
This should give 30 attack if you're facing 4 enemies.
I got one more question, can I check for the turns that passed?
I am thinking of an item that steadily increases in power the longer the fight goes on.
In all honesty, I'm surprised that you haven't figured this out. Because this is trivial.
There should be the javascript solution mentioned somewhere, however I'll mention the simple method.
If you want to keep track of turns that pass, you can use Troop events pages. Namely one page that has a duration of one turn and increases the value of a variable by 1.
ohhh right I can use events too XD sometimes I think too complicated sorry , but thanks for telling me!

Original thread: https://forums.rpgmakerweb.com/threads/traits-depending-on-enemy-count.81101/