Hello John
This is something that all males must go through. I don't believe masturbation directly violates any Buddhist precepts, but one must realize that it is indulgence in sense pleasure. Be aware that pleasure and desire for pleasure exists. Look deeply at its roots. Remember, every time you give into sense pleasure, you strengthen those seeds within you. It is up to you to determine whether those seeds that lie deep within your consciousness are wholesome or unwholesome. Does watering those seeds help remove or strengthen suffering?
There are some meditation exercises that may help. The purpose of these meditations is to develop dispassion for the human body you are lusting for. People usually view the body as something clean, beautiful, and desirable. However, after one meditates on the true nature of the body, they come to see that it is really quite the opposite.
Begin with the breath. Become aware of breathing. Feel how the body responds to both the in-breath and out-breath. Now bring the attention to the whole body. Recite the following phrases:
This body of mine
From the soles of the feet on up
From the crown of the head on down
Surrounded by skin
Filled with all sorts of unclean things.
In this body there is:
Hair of the head, Hair of the body, Nails, Teeth, Skin, Flesh, Tendons, Bone, Bone marrow, Spleen, Heart, Liver, Membranes, Kidneys, Lungs, Large intestines, Small intestines, Digested food, Feces, Brain, Gall, Phlegm, Lymph, Blood, Sweat, Fat, Tears, Oil, Saliva, Mucus, Oil in the joints, Urine
Such is this body of mine
From the soles of the feet on up
From the crown of the head on down
Surrounded by skin
Filled with all sorts of unclean things.
Now imagine what a body smells like if it were never washed with fragrances, what the skin, hair, nails, and teeth would look like if never properly taken care of. Now tell yourself, "The body is of the nature to change, grow old, get sick, die and decay. There is no way it can escape this." Now reflect on what happens to a body once it is dead:
1. The corpse is bloated, blue, and festering.
2. The corpse is crawling with insects and worms. Crows, hawks, vultures, and wolves are tearing it apart to eat.
3. All that is left is a skeleton with some flesh and blood still clinging to it.
4. All that is left is a skeleton with some blood stains, but no more flesh.
5. All that is left is a skeleton with no more blood stains.
6. All that is left is a collection of scattered bones - here an arm, here a shin, here a skull, and so forth.
7. All that is left is a collection of bleached bones.
8. All that is left is a collection of dried bones.
9. The bones have decomposed, and only a pile of dust is left.
These meditations, if done regularly, are know to counteract attachment and desire of the body. If you can see the human body is such a way, then maybe this will help you overcome the powerful sexual energy within you.
Hope this helps. May you find peace and happiness. May you become free from the grip of craving and lust.
"Your mind is en flamed because of distorted perception. Shun the aspect of beauty associated with passion.
"See constructions as other, as painful, not as self, (and thus) extinguish strong passion; do not burn again and again.
"Devote the mind, one-pointed and well-composed, to the contemplation of foulness. Let mindfulness be directed towards the body and be full of disenchantment for it."
-- Thag 21, IV