How would I make a consumable item scale with DEX?

I'd like to give DEX more of a use in my game than just being a pure accuracy stat (since I've already removed critical hits from my game). I noticed that you can make consumables deal damage, but it doesn't seem consumable item damage scales with any stats, so I'd like to tie it to Dexterity, but I can't seem to figure out how.

Any help?

(If scaling the item makes it so healing items also scale, this shouldn't be an issue, as healing consumables in my game go by percentage instead of fixed values)
OK, let's pick this modification of Game_Battler's item_effect method as a starting point.

Ruby:
# * ItemEffect Mod XP * #
#   Scripter : Kyonides Arkanthes
#   2023-12-02

# This scriptlet simply makes the Game_Battler#item_effect method get a heck lot
# more modular than the original script's.

module RPG
  class Item
    def for_nobody?
      @scope == 0
    end

    def for_enemy?
      @scope == 1
    end

    def for_enemies?
      @scope == 2
    end

    def for_ally?
      @scope == 3
    end

    def for_allies?
      @scope == 4
    end

    def for_dead_ally?
      @scope == 5
    end

    def for_dead_allies?
      @scope == 6
    end

    def for_user?
      @scope == 7
    end
  end
end

class Game_Battler
  def item_effect(item)
    @critical = false
    if ((item.for_ally? or item.for_allies?) and self.hp == 0) or
       ((item.for_dead_ally? or item.for_dead_allies?) and self.hp >= 1)
      return false
    end
    effective = false
    effective |= item.common_event_id > 0
    hit_result = (rand(100) < item.hit)
    effective |= item.hit < 100
    if hit_result
      effective = calc_result(item, effective)
    else
      @damage = "Miss"
    end
    @damage = nil unless $game_temp.in_battle
    return effective
  end

  def calc_result(item, effective)
    recover_hp = calc_recover_hp(item)
    recover_sp = calc_recover_sp(item)
    self.damage = -recover_hp
    # HP and SP recovery
    last_hp = self.hp
    last_sp = self.sp
    self.hp += recover_hp
    self.sp += recover_sp
    effective |= self.hp != last_hp
    effective |= self.sp != last_sp
    # State change
    @state_changed = false
    effective |= states_plus(item.plus_state_set)
    effective |= states_minus(item.minus_state_set)
    # If parameter value increase is effective
    if item.parameter_type > 0 and item.parameter_points != 0
      item_effect_param(item)
      effective = true
    end
    if item.recover_hp_rate == 0 and item.recover_hp == 0
      @damage = ""
      if item.recover_sp_rate == 0 and item.recover_sp == 0 and
         (item.parameter_type == 0 or item.parameter_points == 0)
        @damage = "Miss" unless @state_changed
      end
    end
    effective
  end

  def calc_recover_hp(item)
    recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp
    if recover_hp < 0
      recover_hp += self.pdef * item.pdef_f / 20
      recover_hp += self.mdef * item.mdef_f / 20
      recover_hp = [recover_hp, 0].min
    end
    recover_hp *= elements_correct(item.element_set)
    recover_hp /= 100
    if item.variance > 0 and recover_hp.abs > 0
      amp = [recover_hp.abs * item.variance / 100, 1].max
      recover_hp += rand(amp+1) + rand(amp+1) - amp
    end
    recover_hp /= 2 if recover_hp < 0 and guarding?
    recover_hp
  end

  def calc_recover_sp(item)
    recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp
    recover_sp *= elements_correct(item.element_set)
    recover_sp /= 100
    if item.variance > 0 and recover_sp.abs > 0
      amp = [recover_sp.abs * item.variance / 100, 1].max
      recover_sp += rand(amp+1) + rand(amp+1) - amp
    end
    recover_sp
  end

  def item_effect_param(item)
    case item.parameter_type
    when 1  # Max HP
      @maxhp_plus += item.parameter_points
    when 2  # Max SP
      @maxsp_plus += item.parameter_points
    when 3  # Strength
      @str_plus += item.parameter_points
    when 4  # Dexterity
      @dex_plus += item.parameter_points
    when 5  # Agility
      @agi_plus += item.parameter_points
    when 6  # Intelligence
      @int_plus += item.parameter_points
    end
  end
end

Where exactly would you like to place your DEX modifier?
How is it supposed to modify the recover_hp or recover_sp values there?
My idea would be to have it modify recover_hp in the same way it would a regular attack or skill. Problem is, I have no clue what I'm even looking at. Preferably, SP recovery shouldn't scale with it, but I could incorporate it into the game's balancing if need be. Who knows? It might be interesting. I didn't write this code, nor do I know anything about XP's language, so I wouldn't have the first idea of where to put a modifier for it to do exactly what I want.

Based on what I'm seeing though, perhaps the best place to put it would be somewhere in here?
if recover_hp < 0
recover_hp += self.pdef * item.pdef_f / 20
recover_hp += self.mdef * item.mdef_f / 20
recover_hp = [recover_hp, 0].min

Original thread: https://forums.rpgmakerweb.com/threads/how-would-i-make-a-consumable-item-scale-with-dex.162923/