damage and hp code improvement