A parametrised version of Moser's modifying terms theorem