MZ Check if ANY actor has a given buff?

I know this works for a specific actor:

$gameActors.actor(1).isDebuffAffected(7)

But without using tons of fork conditions, is there a way to just check all of them?
Theoretically, you could use javascript for this and just Loop the actors to find what you're looking for.

JavaScript:
for(let i = 0; i < $gameParty.battleMembers().length; i++) {
    if($gameParty.battleMembers()[i].isDebuffAffected(7)) {
    //code or stuff happens.
    }
}
JavaScript:
$gameParty.members().some(member => member.isDebuffAffected(7));
$gameParty.members().some(member => member.isDebuffAffected(7));

Even better.
Even better.
For future reference as well if you're not aware of this, you don't need to specify battleMembers() for something in battle; internally, members() already returns battleMembers() if you're in battle. It only returns allMembers() if you're outside of combat.
For future reference as well if you're not aware of this, you don't need to specify battleMembers() for something in battle; internally, members() already returns battleMembers() if you're in battle. It only returns allMembers() if you're outside of combat.

Thanks, I am. I just was giving a basic example of finding the actor information through a loop. How it's actually done is really up to him. The beauty of programming in my eyes, is that there is so many ways to do things and it's all a part of the BIG learning curve.

Original thread: https://forums.rpgmakerweb.com/threads/check-if-any-actor-has-a-given-buff.153189/