Welcome to HCM.Masturbation
is not harmful to health. It cannot be the cause of pain in the abdomen.
Your lack of concentration in studies could be because your mind is preoccupied with sexual thoughts. Thinking about sex and masturbation are not wrong, but it should be within limits and they should not dominate you.
At your age, sex thoughts are perfectly normal, but do study well, since that is necessary for a successful future.