 Valproate is also used to prevent migraine headaches.Because this medication can be potentially harmful to the fetus, valproate should be considered for those able to become pregnant only after the risks have been discussed.The medication has been tested in the treatment of AIDS and cancer, owing to its histone-deacetylase-inhibiting effects.