Need Help with enemy health bar's and Battle camera script

im using MogHunter's Battle camera and also Yanfly's Enemy health script. the health script works fine as is
but when using the battle camera the guages shift with the camera and the health bar's doesn't remain under the
enemy. I've tried using different enemy bar scripts and its the same result so im assuming it's coming from the battle camera. I've attached the image below for an example of when the camera moves to focus on an enemy how the bar moves over.
Screenshot 2024-03-12 160402.png
Try this
Ruby:
#==============================================================================
# ■ Enemy_HP_Gauge_Viewport
#==============================================================================

class Enemy_HP_Gauge_Viewport < Viewport

  #--------------------------------------------------------------------------
  # update_position
  #--------------------------------------------------------------------------
  def update_position
    dx = -$game_temp.bc_data[0] + @battler.screen_x - @start_width / 2
    dy = -$game_temp.bc_data[1] + @battler.screen_y
    dy += 1 unless @type == :back
    self.rect.x = dx
    self.rect.y = dy
  end
 
end
Try this
Ruby:
#==============================================================================
# ■ Enemy_HP_Gauge_Viewport
#==============================================================================

class Enemy_HP_Gauge_Viewport < Viewport

  #--------------------------------------------------------------------------
  # update_position
  #--------------------------------------------------------------------------
  def update_position
    dx = -$game_temp.bc_data[0] + @battler.screen_x - @start_width / 2
    dy = -$game_temp.bc_data[1] + @battler.screen_y
    self.rect.x = dx
    self.rect.y = dy
  end
 
end
life saver as always! it worked! i do think it became slightly misaligned though here how the red isnt aligned with the black
Screenshot 2024-03-12 210426.png
i do think it became slightly misaligned though
added back one line to move the bar down one pixel

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-enemy-health-bars-and-battle-camera-script.166737/