The effect of neutral gas puffing in ELMy H-mode plasmas is studied using integrated predictive transport modelling, which is needed because of the strong link between the plasma core, the edge transport barrier and the scrape-off layer. Self-consistent results are obtained by coupling the one-dimensional core transport code JETTO with the two-dimensional edge code EDGE2D. In addition, magnetohydrodynamic (MHD) stability analysis is performed on the output of the transport simulations. The results of the MHD stability analysis is used to adjust MHD stability limits in the transport modelling, so that there is a feedback loop between the transport codes and the MHD stability codes. It is shown that strong gas puffing causes a sequence of causalities involving edge density, collisionality, bootstrap current, total edge current and magnetic shear, eventually triggering a transition from second to first ideal (or resistive) n = infty ballooning stability. Qualitatively, the transition from second to first ballooning stability resembles the experimentally observed transition from type I to type III ELMy H-mode with the accompanying increase in ELM frequency and deterioration of plasma confinement.