By moving individual Fe-porphyrin-based molecules with the tip of a scanning tunneling microscope in the vicinity of the elbow of the herringbone-reconstructed Au(111) containing a Br atom, we reversibly and continuously control their magnetic state. Several regimes are obtained experimentally and explored theoretically: from the integer spin limit, through intermediate magnetic states with renormalized magnetic anisotropy, until the Kondo-screened regime, corresponding to a progressive increase of charge fluctuations and mixed valency due to an increase in the interaction of the molecular Fe states with the substrate Fermi sea. Our study demonstrates the potential of utilizing charge fluctuations to generate and tune quantum magnetic states in molecule-surface hybrids.