We show that the magnetic state of individual manganese phthalocyanine (MnPc) molecules on a Bi(110) surface is modified when the Mn2+ center coordinates to CO molecules adsorbed on top. Using scanning tunneling spectroscopy we identified this change in magnetic properties from the broadening of a Kondo- related zero-bias anomaly when the CO-MnPc complex is formed. The original magnetic state can be recovered by selective desorption of individual CO molecules. First principles calculations show that the CO molecule reduces the spin of the adsorbed MnPc from S=1 to S=1/2 and strongly modifies the respective screening channels, driving a transition from an underscreened Kondo state to a state of mixed valence.