Modelling H2 and its effects on star formation using a joint implementation of gadget-3 and KROME