Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

$gameParty.battleMembers()[member_index]._states.filter(state_id => state_id == req_state_id).length

- $gameParty.battleMembers() is the function call to get the battle members

- $gameParty.battleMembers()[member_index] specifies a battle member, member_index must be a number (begins at 0 for first member)

- $gameParty.battleMembers()[member_index]._states gives the states for that member in ID form

- $gameParty.battleMembers()[member_index]._states.filter(state_id => state_id == req_state_id) filters the states and returns an array that meets the required ID. req_state_id must be a number

- $gameParty.battleMembers()[member_index]._states.filter(state_id => state_id == req_state_id).length gives the number of states in the array

I recommend you learn array filter going forward before continuing. 

googling the array filter did not help me understand the arguments

whats the required state id?

i figured out that req_state_id is the only one that gets changed

do the state ids also start at 0 ?