Make minimum damage dealt 1 instead of 0

Hi, 

I am looking for a script that makes the game work so that when an actor attacks an enemy (or vice versa) they always deal at least 1 damage to their target, even if the attacker has 3 ATK and the target has 999 DEF.  There are certain enemies in my game that give lots of EXP, but have massive defense and little HP, (like the metal monsters in "Dragon Quest/Warrior" games) and lower level actors can't touch them.

Thanks!
You don't need a script for this.  You can do this one of two ways.

In your damage formula box do this

[damage formula, 1].max

Apart from taking time, possible typos and omitted skills, Guarding and other skills can still reduce it to 0HP, so as an alternative:

[SIZE=10.5pt]Go to the [/SIZE]make_damage_value method in Game_Battler.

[SIZE=10.5pt]Right before this line:[/SIZE]

@result.make_damage(value.to_i, item)add this

Code:
if value > 0.0value = [value, 1.0].maxend
If you're lazy, you could use this script: http://forums.rpgmakerweb.com/index.php?/topic/953-set-minimum-damage-to-1/?p=9685

Otherwhise, do what's been said by ksjp17.
Thanks for your help, I can't believe you responded so fast!

ksjp17, that 3-line edit to the script you gave me didn't work, so I used the script Jackus gave the link to, and that works fine.
Hmm, interesting. I'll have to look into that a bit more.  Thanks for mentioning.
Hmm, interesting. I'll have to look into that a bit more.  Thanks for mentioning.
It could just be that I entered it wrong.  I'm not sure how RGSS3 handles white space, but I may have gotten the indentation wrong.  You were somewhat ambiguous in that respect for someone who doesn't know much about RGSS3
The whole little section should have ended up looking like this (I think)

Code:
# * Calculate Damage  #--------------------------------------------------------------------------  def make_damage_value(user, item)    value = item.damage.eval(user, self, $game_variables)    value *= item_element_rate(user, item)    value *= pdr if item.physical?    value *= mdr if item.magical?    value *= rec if item.damage.recover?    value = apply_critical(value, user, item) if @result.critical    value = apply_variance(value, item.damage.variance)    value = apply_guard(value)    if value > 0.0      value = [value, 1.0].max    end    @result.make_damage(value.to_i, item)  end
The edit won't work if there are scripts that overwrite make_damage_value.

I did an edit of my own and had to move it due to this issue.

You have to find the lowest version of the method and make your edits there.

Original thread: https://forums.rpgmakerweb.com/threads/make-minimum-damage-dealt-1-instead-of-0.41006/