MV Script to check what frame is currently on screen in an animation

I have a wacky idea I want to try but I would need to know what to call in a script, if this is even possible. Does anyone know if there's a way to check which frame in a currently playing battle animation is currently on screen.

Basically what I am trying to do is; in an action sequence have it loop until its on a certain frame. I already can do loops in an action sequence. I just need to know if there's a script to check what frame of an animation is currently playing.

I hope that at least makes some semblance of sense. Any help as always is greatly appreciated.
Theoretically yes, practically (in your case) no.

the animation is basically updated in the background and you have a counter that counts the animation frame up iirc every second or third frame of the main loop.

your problem is that the action sequence loop will also need time in the frames to count itself up, so both are counting up - the loop you want to do to check the animation status cannot be instant because you want the other updates to still process.

What you could theoretically do is to include your check into the animation update function with a plugin, and have that trigger whatever else - but a loop in action sequences will cause too much timing problems in my opinion.
Theoretically yes, practically (in your case) no.

the animation is basically updated in the background and you have a counter that counts the animation frame up iirc every second or third frame of the main loop.

your problem is that the action sequence loop will also need time in the frames to count itself up, so both are counting up - the loop you want to do to check the animation status cannot be instant because you want the other updates to still process.

What you could theoretically do is to include your check into the animation update function with a plugin, and have that trigger whatever else - but a loop in action sequences will cause too much timing problems in my opinion.
Gotcha, thanks for the reply. I have a Button Mash Timed Attack that goes for a certain amount of time, but if the player is really fast and gets the gauge full sooner than the alotted time it throws off the animation timing. So I thought if i could have the sequence know what animation frame it was at when the Timed Attack Minigame finished I could throw a conditional there.

Basically something like While animation frame is less than X continue to loop. And once it hits the needed frame move on with the sequence.

I'll have to go with my other plan to have the timed attack some how wait the same amount of time regardless as to how fast the mini game is completed. Regardless I appreciate the response!
Hmmm, I didn't read all that but if you want the frame for a battle animation for a battler that has 1 animation playing and you have Yanfly Battle Core turned on, I think it's like (change correct battler reference):

$gameTroop.members()[0].battler()._animationSprites[0].currentFrameIndex()
Hmmm, I didn't read all that but if you want the frame for a battle animation for a battler that has 1 animation playing and you have Yanfly Battle Core turned on, I think it's like (change correct battler reference):

$gameTroop.members()[0].battler()._animationSprites[0].currentFrameIndex()
Thank you, I'll give it a try!

Original thread: https://forums.rpgmakerweb.com/threads/script-to-check-what-frame-is-currently-on-screen-in-an-animation.179836/