This Letter reports on observed interplay between beam-driven modes of sweeping frequency (chirping modes) and transitions to the enhanced global confinement regime (H-mode) and back to the low confinement regime (L-mode) in the spherical tokamak ST40. The H-modes of plasma confinement are identified from decreased intensity of Dα signal and from clear distinctions in the edge gradients of the visible plasma boundary (observed as a sharp plasma edge in CCD images). The beam-driven chirping modes, identified as ideal MHD BAAE modes, are observed in Mirnov coil signals, interferometry, and soft X-ray diagnostics. A moderate amplitude “primer” chirping mode usually precedes an H-L transition. This is followed by a “dominant” chirping mode with higher amplitude during the L-mode. The L-H transition back to the improved confinement occurs on a longer time scale of tens of ms, consistent with the slowing down time scale of fast beam ions. A dramatic decrease in toroidal plasma rotation is systematically observed associated with chirping modes sweeping down to zero frequency. Resonance maps built for the beam-driven chirping modes with the ASCOT code show that the resonant beam ions have orbits near the trapped-passing boundary. The ASCOT modelling assesses how losses of the resonant fast ions caused by the chirping modes with high enough amplitude modify the torque, potentially affecting the plasma rotation.