MV Checking alive members in a game troop

Hi everyone!

Hoping to find some help on this little issue.

I'm using an if statement in a YEP action sequence that looks like this:

if ($gameTroop._enemies.filter(function(c) {return c._enemyId === 13;}).length === 2)

This works just fine, but I need something slightly different.

What I actually need it to do is more like:

"if the gametroop contains two ALIVE enemies that match enemy ID 13"

It's an extra caveat on the statement, but ideally I still want to do it with one single line.

Can anyone help at all?

Thanks so much!
You can make the check using this code 😤

Code:
$gameTroop.members().filter(function(e) {return e.enemyId() === 13 && e.isAlive()}).length === 2

I think this should make the trick!
Thanks so much!

Original thread: https://forums.rpgmakerweb.com/threads/checking-alive-members-in-a-game-troop.139334/