MV Is there any command that can check what face is currently applied on an actor?

So in my game, I was looking at changing actor faces with states. I found this forum that gave me the command using yanfly's buffs and states core to change the face for the actor when states are applied.
Spoiler: js
<Custom Apply Effect>

if (target.isActor()) {

if (target.actorId() === 1) {

target.setFaceImage('filename', index);

} else if (target.actorId() === 2) {

target.setFaceImage('filename', index);

} else if (target.actorId() === 3) {

target.setFaceImage('filename', index);

}

}

</Custom Apply Effect>

<Custom Remove Effect>

if (target.isActor()) {

if (target.actorId() === 1) {

target.setFaceImage('filename', index);

} else if (target.actorId() === 2) {

target.setFaceImage('filename', index);

} else if (target.actorId() === 3) {

target.setFaceImage('filename', index);

}

}

</Custom Remove Effect>
One of my actors ages throughout the game so I plan on using the change actor images command to do that. So the issue would be that I would want it to run a command in battle to check what face image is currently being used so I would be able to switch the sprite to a different one based on the characters age. Would I just do that by increasing a variable every time the actor ages up and the command would look like this:
JavaScript:
<Custom Apply Effect>

if (target.isActor()) {

if (target.actorId() === 1) {
{
    if (gameVariables.value(1) == 0)
target.setFaceImage('filename', index);
}
    else if (gameVariables.value(1) == 1)
target.setFaceImage('filename', index)
}

} else if (target.actorId() === 2) {

target.setFaceImage('filename', index);

} 

}

</Custom Apply Effect>
I'm not great with js so I'm not completely sure if that would work so if there's something I'm missing or any other way to do this that would be great to know.
You're asking two different things. You say

I would want it to run a command in battle to check what face image is currently being used
but then you never try to do that.
Would I just do that by increasing a variable every time the actor ages up
Maybe? How are you tracking age in the first place? You can use whatever you already have for this purpose. Unless you're not yet doing anything to track and change age, in which case I'd suggest you get that entire system very thoroughly figured out before you try to do something so granular as this.

Otherwise, you run every risk of finding out you need to change that system later and then have to rewrite everything that was based off of it.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-any-command-that-can-check-what-face-is-currently-applied-on-an-actor.140436/