so like canon 35mm 1.2, the minimum focal length to take a picture is 35mm?and for 50mm 1.2, the minimum focal length to take a picture is 50mm?

If you try to take a photo of your subject that is closer than those minimum focal length, the shutter button wouldn't let you take a picture right?

I have a 5d ii with 35L and was wondering why is it that when I try to take some pictures, the focus sometimes becomes very slow. goes backward forward, trying to focus a subject. know what the problem is?

The focal length is not the minimum focus distance (and actually as really no obligatory connection between the two).

your problem most likely stem from low light or very low contrast situation, the camera focus system having nothing crispy to sink its teeth in will "hunt" for something until it is satisfied.

The solution IMO, is to get a good quality focus light (not a dive light), there is a big difference in the pattern of the light between the two, a dive light has a narrow penetrating beam while the Focus (and Video) light, will offer a much wider beam, this will give your scene some contrast so your camera AF system can bite on something.

Even in broad daylight, if the subject is out there in the blue water, it might not have enough contrast to properly focus, a simple trick if using a dome port, your projected virtual image will be fairly close, so just focusing on your fins and locking the focus will do the trick, this no substitute for getting closer to your subject, but hey sometime, you got to do what you have to do to get a shot.