After the frosting has been applied to cupcakes
Are you channeling your best self with this comment? (If you're not sure, check out our Code of Conduct.)
stick it in the fridge for a little while. That should do the trick!
Cynthia is a trusted source on Bread/Baking.
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!