## 2 Method
### Setting  
Treatment and testing were performed from April 2021 to June 2023 by the TMS operators working at CIP-TMS (Milan).  
The TMS stimulation was administered in a quiet dedicated treatment room using a MagPro R30 device equipped with the Cool-B80 figure-of-eight coil (MagVenture, Falun, Denmark). Before launching the protocol, the resting motor threshold (rMT) was estimated through a manual procedure based on observation of contralateral (right) hand twitches evoked by left primary motor cortex (M1) stimulation with a single TMS pulse. The M1 hotspot was identified by moving in the coronal plane \(\sim\)5 cm to the left from the vertex.  
The coil was positioned over the presumed M1 region, with the main coil axis forming a 45\({}^{\circ}\) angle with the head's midline, and adjusted until a consistent abductor _pollicis brevis_ response at the lowest stimulator intensity was identified. For subjects with SUD, the treatment entailed two trains per day of intermittent theta-burst stimulation (iTBS) over the left dIPFC, each lasting for 3 min, delivered at an intensity equal to 100% of rMT. The theta-burst stimulation pattern was composed of bursts of 3 biphasic pulses with an inter-pulse interval of 20 ms, repeated at 5 Hz. We employed a standard iTBS protocol consisting of 20 stimulation trains, each lasting for 2.0 s (10 bursts, 30 pulses), with an inter-train interval of 8.0 s [16]. A total of 1200 pulses per visit were administered across the two sessions. Turning to MDD patients, the treatment included a daily session of iTBS over the left dIPFC, lasting for 17 min, delivered at an intensity equal to 120% of rMT. This iTBS stimulation pattern was composed of bursts of 2 biphasic pulses with an inter-pulse interval of 10 ms, repeated at 10 Hz. We employed a custom iTBS protocol consisting of 75 stimulation trains, each lasting for 2.0 s (40 bursts, 80 pulses), with an inter-train interval of 11.0 s. A total of 6000 pulses per visit were administered. For subjects suffering from OCD, the treatment comprised six sessions of cTBS over the pre-supplementary motor area (pre-SMA), each lasting for 10 min, delivered at an intensity equal to 110% of rMT. The theta-burst stimulation pattern was composed of bursts of 2 biphasic pulses with an inter-pulse interval of 20 ms, repeated at 1 Hz. We employed a standard cTBS protocol consisting of 6 uninterrupted stimulation trains, each lasting for 40.0 s (100 bursts, 200 pulses) [16]. A total of 7200 pulses per visit were administered across the six stimulation trains.  
The dIPFC stimulation site was identified on the scalp by moving 5 cm rostrally from the M1 hotspot towards the pupil, whereas pre-SMA was localized 2 cm anterior to the vertex [17]. Figure 1a illustrates the specific placement of the stimulation, confined to the left dIPFC, as well as a smooth approximation of the electromagnetic filed induced by TMS. Similarly, Figure 1b depicts the precise location of the stimulation, limited to the pre-SMA, along with a smooth representation of the electromagnetic field generated by TMS.  
Figure 1: **Simulation of the electrical field distribution generated by TMS stimulation.** SimNIBS 4.1.0 ([[https://simnibs.github.io/simnibs/build/html/index.html](https://simnibs.github.io/simnibs/build/html/index.html)]([https://simnibs.github.io/simnibs/build/html/index.html](https://simnibs.github.io/simnibs/build/html/index.html)), accessed on 12 June 2021 ) was used in order to estimate the normalized electric field (normE) induced by TMS [18]. Among the validated coil models currently available [19], a MagVenture MC-B80 figure-of-eight coil was chosen for running the simulation. The 10–20 system was used as a reference for positioning. The coil was placed over the F3 site to simulate electrical field distribution generated by TMS stimulation over dIPFC, for SUD and MDD (**a**). Conversely, the coil was positioned over FCz to simulate electrical field distribution generated by TMS stimulation over pre-SMA, for OCD (**b**).