After the frosting has been applied to cupcakes
stick it in the fridge for a little while. That should do the trick!
You can also whip a little cornstarch into it.
To add onto Mrslarkin's advice: put them in the freezer if it's an extreme case. Frozen cupcakes are fun too!