[YEP Tips and Tricks - Joint Penalty] Check for all characters in battle

Hi all,

I'm trying to do something similar to what Yanfly did in the "Joint Penalty" Tips and Tricks video ()

The only difference, is I want to have the damage divided between all characters with the state, regardless of them being in the same party.

I believe the section I need to change is this:

Code:
  // Get the living members of the same party.
  var members = target.friendsUnit().aliveMembers();

But I'm not sure how to call for all targets, both friend or foe... can anyone help me??

Thanks!!

Original thread: https://forums.rpgmakerweb.com/threads/yep-tips-and-tricks-joint-penalty-check-for-all-characters-in-battle.121961/