States like Dark Souls?

So, not exactly sure where to put this, but whatever.
Does anyone know how to make states that behave like they do in Dark Souls in RPG Maker VX Ace?
Basically, let's say you have a poison sword. It deals damage, as well as 20 poison build up. The enemy you're fighting has 40 poison resistance. So, when you hit them, nothing seems to happen. But their poison gauge is filled up by 20. If you were to hit them again, the gauge would be full, 20 + 20 = 40. Then, they would get poison.

Anyone know how to do this? I tried variables, but it only worked if there was one target.
I have moved this thread to RPG Maker VXAce Support.
It sounds as you'd need a script to heavily modify the default state processing system.
Okay, this sure ain't perfect but you can utilise Neon Black's Stacking States script and do some editing to the script and your database to get something like what you're after.

Ruby:
if state_addable?(state_id)
    #so I figure you have two states: "poisoning" and "poisoned"
    #"posioning" wouldn't have much of an effect, it's just there for counting
    #you could change (state_id) down here vv to the specific "poisoning" state (I think)
      if state_stack(state_id) >= 2 #and compare it to a variable of your choosing (you could repurpose a dud stat like self.mrf?)
        add_state(10) #and add your "poisoned" state here
        else
      add_new_state(state_id) unless max_state_stack?(state_id)
      reset_state_counts(state_id)
      @result.added_states.push(state_id).uniq!
    end
  end
  end

Now this is very messy and I figure probably would fall apart if you had multiple states you wanted to do this sort of thing with (poison resist, shock resist, burn resist etc.) but I feel like you could probably play around with this as a starting point. I tested it exactly once before posting, and it seemed to work but your mileage may vary.

(those with more ruby knowledge please let me know how many terrible things I've done here <3)
Okay, this sure ain't perfect but you can utilise Neon Black's Stacking States script and do some editing to the script and your database to get something like what you're after.

Ruby:
if state_addable?(state_id)
    #so I figure you have two states: "poisoning" and "poisoned"
    #"posioning" wouldn't have much of an effect, it's just there for counting
    #you could change (state_id) down here vv to the specific "poisoning" state (I think)
      if state_stack(state_id) >= 2 #and compare it to a variable of your choosing (you could repurpose a dud stat like self.mrf?)
        add_state(10) #and add your "poisoned" state here
        else
      add_new_state(state_id) unless max_state_stack?(state_id)
      reset_state_counts(state_id)
      @result.added_states.push(state_id).uniq!
    end
  end
  end

Now this is very messy and I figure probably would fall apart if you had multiple states you wanted to do this sort of thing with (poison resist, shock resist, burn resist etc.) but I feel like you could probably play around with this as a starting point. I tested it exactly once before posting, and it seemed to work but your mileage may vary.

(those with more ruby knowledge please let me know how many terrible things I've done here <3)
Thanks! This could really REALLY help!

Original thread: https://forums.rpgmakerweb.com/threads/states-like-dark-souls.159208/