Problem with Crystal Engine Extra Stats

First off I don't know where to post this so please move if this is the wrong place.

I cannot seem to figure out why I can't get a damage output from enemies attacking my players. Their damage is nulled out no matter how high their stats are.

Here is the code section where my stats are set up:
Code:
    #Default xstat formulas for ACTORS
    DEFAULT_LEVEL_FORMULA = {
      :str => '23 + ((level * 70) / 128)',
      :vit => '24 + ((level * 48) / 128)',
      :spi => '20 + ((level * 57) / 128)',
      :int => '20 + ((level * 57) / 128)',
      :hit => 'param(6)/16',
      :mhi => '((xstat.spi / 16) + (xstat.int / 16)) - 1',
      :dmg => '((param(2)*4) + (xstat.str * 4))',
      }
   
    #Default xstat formulas for ENEMIES   
    DEFAULT_FOR_ENEMIES = {
    :str => '1',
    :vit => '1',
    :spi => '1',
    :int => '1',
    :hit => '1',
    :mhi => '1',
    :dmg => '((param(2)) * 4 + (xstat.str * 4))',
    }

Here is my default attack formula:
(a.xstat.dmg * a.xstat.hit) - ((b.def * 4) + (b.xstat.vit * 4))

Now I set the enemies stats individually through enemy notetags, but no matter what I set it to, the damage returned when an enemy attacks my characters is returned as 0. My players do damage normally and it calculates the enemy's defense as normal too. Here is a notetag box of one of my enemies, who also has 13 ATK and 9 DEF
Code:
<xstat>
:str => '7',
:vit => '3',
:spi => '2',
:int => '3',
:hit => '1',
:dmg => '(param(2)) + (xstat.str * 4)',
</xstat_end>
<teach point: 1>

I cannot figure out what is going on here. I can max everything out and the damage is still 0.
'Scripts' is where people who have written scripts they want to share with the community can post them.

Moved to: RGSSx Script Support

Please edit your opening post and include a link to the web page where you got the script so that if people need to refer to the full script to help you, they don't have to go hunting for it.
Noted. I typically don’t need to use forums cause I can typically troubleshoot until I figure it out. But this one has got me. Unless I can’t use param(2) in the damage formula and I need to just scrap the DMG stat period.

Anyone have any good damage formulas that use STR as the main stat and ATK mainly as weapon strength. My games ATK and DEF is almost entirely based on the weapon and armors strength. You can put points into ATK and DEF but I want STR and VIT to matter more. But I would like it to even be able to do damage that the attackers ATK has to be equal or greater than the Enemies DEF.
You still didn't include the link to the script 🙁
Anyway, to troubleshoot damage, you can try to insert this
Code:
class Game_Battler
  def make_damage_value(user, item)
    a = user; b = self; v = $game_variables
    value = (a.xstat.dmg * a.xstat.hit) - ((b.def * 4) + (b.xstat.vit * 4))
    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) if @result.critical
    value = apply_variance(value, item.damage.variance)
    value = apply_guard(value)
    @result.make_damage(value.to_i, item)
  end
end
See if it yields an error

But still, you still didn't include the link to the script 🙁
Whoops. My bad. Here is the link. https://onedrive.live.com/?cid=E2D867181608A2AA&id=E2D867181608A2AA!707&parId=E2D867181608A2AA!694&o=OneUp

I will try that script when I get home and see what it does.

EDIT: Stupid question but where is the best place to insert that code?

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-crystal-engine-extra-stats.95864/