MV Another STATE help Thread

I would like to make this code [for an Enfire type State] to have a baseDamage of HALF the damage of the attack used...

Code:
<Custom Confirm Effect>
if (this.isHpEffect() && this.isAttack() && this.isPhysical()) {
  // Get the element ID.
  var elementId = 6;
  // Set the damage for the effect.
  var baseDamage = 20;
  // Calculate the damage after applying the target's element rate.
  var damage = Math.ceil(target.elementRate(elementId) * baseDamage);
  // Make a copy of the target's results.
  var result = JsonEx.makeDeepCopy(target._result);
  // Clear the result.
  target.clearResult();
  // Play an animation on the target.
  target.startAnimation(130);
  // Deduct HP from the target.
  target.gainHp(-damage);
  // Start the damage popup.
  target.startDamagePopup();
  // Check if the target is dead.
  if (target.isDead()) {
    //
    target.performCollapse();
  }
  target.clearResult();
  target._result = result;
}
</Custom Confirm Effect>

I know it has to do with the line BaseDamage = 20... But I don't know the syntax I need to make it work.

I've moved this thread to Javascript/Plugin Support. Thank you.


I know it has to do with the line BaseDamage = 20... But I don't know the syntax I need to make it work.
value/2
Oh hey... didn't see this until now. This worked great thanks

Original thread: https://forums.rpgmakerweb.com/threads/another-state-help-thread.182682/