Karma is not a law of rewards and punishment by some judging entity in the Universe. It is simply the spiritual law of cause and effect as the result of your actions. It is, by definition, bad karma if you are harming yourself physically because harming means something bad is happening. It hurts you. It is not something good, peaceful, harmonious, or enlightening.
Therefore it is bad Karma to harm yourself physically but you are not “getting” bad Karma.