Inclusion Criteria:  18-65, inclusive Have a diagnosis of moderate or severe Cocaine or Methamphetamine Use Disorder (CUD/MUD) over the past 12 months (as determined by DSM-5 diagnostic criteria). Have used cocaine or methamphetamine on at least 10 of the last 30 days (based on Timeline Follow-Back). Be interested in decreasing cocaine and/or methamphetamine use. If female, willing to use appropriate birth control method during the treatment phase of the study. Be able to understand the study procedures and provide written informed consent to participate in the study. If prescribed benzodiazepines or anticonvulsants, must be on a stable dose for at least 4 weeks prior to consent.  Exclusion Criteria:  A Diagnostic and Statistical Manual (DSM-5) diagnosis of moderate or severe SUD of any substance other than cocaine or methamphetamine based on DSM-5. History of a serious medical disorder that, in the opinion of the Medical Clinician, would make it unsafe to participate in the study or may prevent collection of study data. Is currently engaged in formal SUD treatment. Documented history of unprovoked seizure (lifetime) or any seizure in the past 6 months. Documented history of brain lesion(s) and/or tumor(s). Metal implants or non-removable metal objects above the waist. Currently pregnant. Lifetime history of prior clinical treatment with TMS. Current or lifetime bipolar disorder. Current psychotic disorder or psychotic depression. Serious risk of homicide or suicide. Are a prisoner or in police custody at the time of eligibility screening. Previously randomized as a participant in the study. Planned admission to a residential treatment facility or other formal SUD treatment program. Unwilling or unable to follow study procedures.