[ACE] Getting Stacking States to work with Field States installed?

Ah, two very useful scripts... https://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/field-state-effects/

and http://forums.rpgmakerweb.com/index.php?/topic/14110-stacking-states/

but no matter how you position them, Stacking States will not work with Field States.

That is because of line 459 of Field State Effects

alias game_battlerbase_states_fse states def states result = game_battlerbase_states_fse result |= field_states unless @anti_field_states return result endI'm not sure what the process |= does in ruby as searching up '|=' of course does not return results, but it seems as if this process somehow removes the duplicate states of Stacking States. 

This can be tested by having the state Poison multiply ATK by 200%, and adding the state via the call

$game_party.all_members.each {|mem| mem.add_state(2); mem.add_state(2)}ATK will only be multiplied by 200 despite the stack count for Poison saying 2, whereas it should be multiplied by 400%.

I already had to make the adjustment to Stacking States to work with Field State Effects

Code:
  def update_state_turns    states.uniq.each do |state|      #my edit-- states with no state turns (like field states) do not       #have their state turns reduced      #--      #@state_turns[state.id] -= 1 if @state_turns[state.id] > 0       if @state_turns[state.id] != nil        @state_turns[state.id] -= 1 if @state_turns[state.id] > 0       end      #--    end  end
I don't know these scripts or the properties of the "states" hash (or is it an array?) well enough to provide you with an answer, but as far as the " |= " operator, this link should prove somewhat helpful.  It looks like it's called "bitwise OR assignment" which means that it's shorthand for looking at what either of the two hashes/arrays mentioned in the line contains, and assigning all of that information to the hash/array on the left-hand side.
Well in the link provided, it does say

>> x = [1,2,3]>> y = [3,4,5]>> x |= y>> x=> [1, 2, 3, 4, 5]As you can see, 3 is included twice and is weeded out in the end result. So, it would lead me to believe that this part of the script removes combines the already applied states and the states applied to the field and then removes duplicates, going against the nature of Stacking States.

Via testing, I found that 

x = [1,1,5]y = [2,3,4]x |= ywould return as 

x = [1,5,2,3,4] I would assume that this part of the script makes it so that, for example, if the state Poison was applied as a field state, a battler who already had the Poison state individually would only have one instance of it rather than two.

So, what if I made it so that all states are duplicated unless otherwise specified?

'states' is an array of already applied states, and 'field_states' is an array of active states applied to all participants, so how would one, say, do something to the effect of

field_states.each {|object| return if [3,6].any? {|id| self.state?(id) and object == $data_states[id]}; states.push(object)}meaning that each of the field states will be put into the states array (aka be applied to the battler) except for those of the ids 3 and 6, meaning Blind and Sleep?

Or, I could ask, how could I do something to the effect of 

field_states.each {|object| if self.state?(object.id);then if [2,17].any? {|id| object == $data_states[id]} then states.push(object) end;else states.push(object) end}Where if the battler has given field state already applied normally, the state will only be added to the states array if its id is within a specific list, in this case being Poison and Ironbody?

Original thread: https://forums.rpgmakerweb.com/threads/ace-getting-stacking-states-to-work-with-field-states-installed.45975/