If the state is on the parent object, the for each loop should be for the parent, then you can scope the child objects, which should store the fixed value of the parent.
Then you can easily check...