k, i'm not that good in takedowns,so take my advice with a grain of salt.
Usually from what i understand if they are doing a double leg or single leg takedowns they have to clear your defenses first(which is your head,hands, fore arm and hips)they clear this one by changing levels(they have to be lower than you when they shoot) and by pushing or shoving up your defenses.
so my advice is , when they change level,..you change level with them and go for underhooks.
Example of getting the underhook while they are about to do a double or single would be , you changing level with your opponent:
a)your left hand/forearm would be shoving or pushing his head/shoulder(if they pass this defense) and
b)your right elbow is tuck to your body , your right arm is on the outside of your right thigh(so when they shoot for a double or single you already got the underhook)
c)feet are slightly apart(kinda like squatting but your left leg is in the back , and your right knee is pointing at your opponent)
if you still did not get the underhook and they pass all your defenses, you still have the good old sprawl