Using cosmological galaxy formation simulations from the MaGICC project, spanning more than three magnitudes in stellar mass (~10^7-3x10^{10} Msun), we trace the baryonic cycle of infalling gas from the virial radius through to its participation in the star formation process. An emphasis is placed upon the temporal history of chemical enrichment during its passage through the corona and CGM. We derive the distributions of time between gas crossing the virial radius and being accreted to the star forming region (which allows mixing within the corona), as well as the time between gas being accreted to the star forming region and then forming stars (which allows mixing within the disc). Significant numbers of stars are formed from gas that cycles back through the hot halo after first accreting to the star forming region. Gas entering high mass galaxies is pre-enriched in low mass proto-galaxies prior to entering the virial radius of the central progenitor, with only small amounts of primordial gas accreted, even at high redshift (z~5). After entering the virial radius, significant further enrichment occurs prior to the accretion of the gas to the star forming region, with gas that is feeding the star forming region surpassing 0.1Z by z=0. Mixing with halo gas, itself enriched via galactic fountains, is thus crucial in determining the metallicity at which gas is accreted to the disc. The lowest mass simulation (Mvir~2x10^{10}Msun, with M*~10^7Msun), by contrast, accretes primordial gas through the virial radius and onto the disc at all times. Much like the classical analytical solutions to the `G-dwarf problem, overproduction of low-metallicity stars is ameliorated by the inefficiency of star formation. Finally, gas outflow/metal removal rates from star forming regions as a function of galactic mass are presented.