Help with Multiple Slip Damage Calculations

Oh boy, here I go posting in this forum again!

So I want to make multiple poison-like effects in my game (similar to how in the Aveyond series, there's multiple kinds of damage over time effects [Poison, Toxic Poison, Weevils, Plague]). The issue I've run into is I don't know how to make it so that the slip damage, as it's called, varies between the four (or more. I'm planning on adding a bleed effect that's weaker than Poison). I know where it's calculated, Game_Battler_3 for in battle, though I'm unsure if the same region of code also effects - affects?... English is weird- the slip damage outside of battle. Probably, considering wherever slip damage is mentioned in the scripts, there's no equation for damage other than in Game_Battler_3.

The line of code I'm looking at is around line 319 in Game_Battler_3:
Code:
 #--------------------------------------------------------------------------
  # * Application of Slip Damage Effects
  #--------------------------------------------------------------------------
  def slip_damage_effect
    # Set damage
    self.damage = self.maxhp / 10
    # Dispersion
    if self.damage.abs > 0
      amp = [self.damage.abs * 15 / 100, 1].max
      self.damage += rand(amp+1) + rand(amp+1) - amp
    end
    # Subtract damage from HP
    self.hp -= self.damage
    # End Method
    return true
  end
I kind of know what I need to do to make what I want work: make it so that depending on the state's ID, the equation is different. In short, I need to attach an ID to an equation.
I just don't quite know how to do it, and I might need to edit the other scripts where slip damage is mentioned for it to work, but I'm not sure.
You can use a negative HP regen feature value to do this but it only allows you to use %HP... If you want more control, you can try my Slip Damage Ex Script assuming this is for VX Ace https://lescripts.wordpress.com/rgss3/slip-damage-ex/
You may wanna instead try Yeyinde's Multiple Poisons. Gotta love a guy who's avatar has been a 'Predator' since 2000.

This script allows a game to have different types of poisons. Whether the poison is a minor infection, or a serious disease, this script will suit your need for poisons.

Instructions

Insert the script into a new section above Main. Edit the BATTLE_DAMAGE and MAP_DAMAGE constant Hashes with the following format: {state_id => damage_division} where state_id is the ID of the status in the database(no leading 0s), and damage_division is the number which maxhp will be divided by to get the damage for that state (example: 100 = maxhp / 100, 25 = maxhp / 25)
If you want damage to be taken from the actor's SP, add the state id to the SP_POISONS constant array. (SP_POISONS = [3, 6] would make states 3 and 6 remove from SP)

Code:
#==============================================================================
#  ** Multiple Poisons
#------------------------------------------------------------------------------
#  Scripted by: Yeyinde
#  Version 1.1.0
#  February 1 & 2, 2007
#==============================================================================

#--------------------------------------------------------------------------
# * Initialize Constants
#--------------------------------------------------------------------------

SP_POISONS = [] # Add the state ids of SP draining poisons here
BATTLE_DAMAGE = {} # Format: state_id => damage_division
BATTLE_DAMAGE.default = 10 # Do not change
MAP_DAMAGE = {} # Format: state_id => damage_division
MAP_DAMAGE.default = 100 # Do not change

# Damage correction (To prevent /0 errors)
# DO NOT EDIT!
BATTLE_DAMAGE.each do |state_id, damage|
  BATTLE_DAMAGE[state_id] = BATTLE_DAMAGE.default if damage == 0
end
MAP_DAMAGE.each do |state_id, damage|
  MAP_DAMAGE[state_id] = MAP_DAMAGE.default if damage == 0
end

#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Application of Slip Damage Effects - Overwrite
  #--------------------------------------------------------------------------
  def slip_damage_effect
    # Set damage
    self.damage = 0
    sp_damage = 0
    # Branch per state held
    @states.each do |i|
      # If the state has slip damage
      if $data_states[i].slip_damage
        # Add to damage
        if SP_POISONS.include?(i)
          sp_damage += self.maxsp / BATTLE_DAMAGE[i]
        else
          self.damage += self.maxhp / BATTLE_DAMAGE[i]
        end
      end
    end
    # Dispersion
    if self.damage.abs > 0
      amp = [self.damage * 15 / 100, 1].max
      self.damage += rand(amp+1) + rand(amp+1) - amp
    end
    if sp_damage.abs > 0
      amp = [sp_damage * 15 / 100, 1].max
      sp_damage += rand(amp+1) + rand(amp+1) - amp
    end
    # Subtract damage from HP and SP
    self.hp -= self.damage
    self.sp -= sp_damage
    # End Method
    return true
  end
end


#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party. It includes information on amount of gold
#  and items. Refer to "$game_party" for the instance of this class.
#==============================================================================

class Game_Party
  #--------------------------------------------------------------------------
  # * Slip Damage Check (for map) - Overwrite
  #--------------------------------------------------------------------------
  def check_map_slip_damage
    # Branch per actor
    @actors.each do |actor|
      # If actor has more than 0 HP and has a slip damage state
      if actor.hp > 0 and actor.slip_damage?
        # Set damage
        damage = 0
        sp_damage = 0
        # Branch per state held
        actor.states.each do |i|
          # If the state has slip damage
          if $data_states[i].slip_damage
            # Add to damage
            if SP_POISONS.include?(i)
              sp_damage += actor.maxsp / MAP_DAMAGE[i]
            else
              damage += actor.maxhp / MAP_DAMAGE[i]
            end
          end
        end
        # Take damage
        if damage > 0
          actor.hp -= [damage, 1].max
        elsif damage < 0
          actor.hp -= [damage, -1].min
        end
        # Take SP damage
        if sp_damage > 0
          actor.sp -= [sp_damage, 1].max
        elsif sp_damage < 0
          actor.sp -= [sp_damage, -1].min
        end
        # If the actor has no more HP
        if actor.hp == 0
          # Play the actor collapse SE
          $game_system.se_play($data_system.actor_collapse_se)
        end
        # Flash the screen to indicate damage
        if damage > 0 or sp_damage > 0
          $game_screen.start_flash(Color.new(255,0,0,128), 4)
        elsif damage < 0 or sp_damage < 0
          $game_screen.start_flash(Color.new(0,255,0,128), 4)
        end
        # Go to game over if the party is all dead
        $game_temp.gameover = $game_party.all_dead?
      end
    end
  end
end
You can also check out my script called "State Slip Skills". It allows you to define multiple skills that are then used for poison damage calculation. This allows you to take into account things about the caster (if you want) to determine the damage done per turn. Link: https://forums.rpgmakerweb.com/index.php?threads/state-slip-skills.45242/
Yeyinde's Multiple Poisons seems closest to what I'm looking for (don't ever recall finding it when looking for help before I posted the thread). Thanks guys.
Hehe... Look at the date of the script. I've had it in my collection for over a decade. But to be honest, I think it got lost over the years. Gotta love what that scripting Yautja did.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-multiple-slip-damage-calculations.107710/