Mix together in a bowl your flour, sugar, salt, and baking soda.
In a pot on the stove, melt your butter, add the water, and cocoa powder. Bring to a boil.
Once it has boiled, add it to your bowl with your dry ingredients. Whisk together until there are no lumps.
Add your egg, buttermilk, and vanilla. Whisk again.
Set your oven to 350°F and line your muffin tin your liners.
I like to use an ice cream scooper for cupcakes, so, fill your liners ¾ of the way up.
Place in the oven between 18-20 minutes. When you remove them from the oven, you should be able to stick a toothpick in the middle and for it to come out clean.
Let the cupcakes cool in the tin for about 15 minutes. Once they have cooled a bit, transfer to a wire wrack.
While they are cooling, you can go ahead and make your icing.
Icing
Take your softened butter and cream cheese and beat with the paddle attachment in your mixer. Let it beat for a few minutes so it gets nice and fluffy.
Add your powdered sugar and let it carry on for a few minutes as it forms into icing.
It is going to seem a bit stiff, so, now you will add your milk or cream.
Take a bit of the icing out of the bowl, as you will mix this with the four house colors.
Once you have your reserved amount out of the bowl (you won't need much) add your cocoa powder to the icing. If you feel it is too stiff, then, add 1 more tablespoon of cream.
Back to your cupcakes:
You are going to make a divit in each of the cupcakes. This is where the color for each house will go.
Separate the icing you took out and place it into 4 bowls, and mix your red, yellow, green, and blue (yay Ravenclaw!).
Fill the cupcakes with the colors.
Once you have filled your cupcakes, fill a piping bag with the chocolate icing and cover the tops so that no one can see what is inside! You want them to be surprised.
Place your hats on top and voila! You have successfully made sorting hat cupcakes!