Towards understanding edge localised mode mitigation by resonant magnetic perturbations in MAST