Add the butter, milk, and sugar to a large saucepan over medium heat and allow to melt, stirring occasionlly.
Add the egg yolks to a small bowl and ladle in about 2 tablespoons of the warm stovetop mixture. Stir, and repeat once more.
Then, add the egg mixture to the saucepan and stir. Simmer for about 10 minutes, stirring often, until the mixture has thickened.
Remove from the heat and stir in the vanilla and salt, followed by the coconut, and pecans.
Transfer to a bowl and place in the refrigerator to cool for about 2-3 hours to chill. In the meantime, bake the cupcakes.
Make the Cupcakes
Preheat the oven to 350°F, and have ready two 12-cup muffin tins lined with baking cups.
Whisk together the flour, cocoa powder, baking powder, baking soda, and salt in a medium-sized mixing bowl. Set aside until ready to use.
Add the sugar and eggs to the bowl of a stand mixer fitted with a paddle attachment. If you do not have a stand mixer, use a large mixing bowl and a handheld mixer. Mix on medium-high speed for 2-3 minutes until visibly lightened in color and thickened. Add the oil and vanilla and mix until evenly incorporated.
Add half of the dry ingredients to the wet ingredients, and mix on low until evenly incorporated. Then, add half of the milk and mix again. Add the remaining dry ingredients, mix on low, and add the remaining milk. Mix until evenly incorporated. Using a spoon, scrape down the side of the bowl and mix once more.
Fill the baking cups halfway full, and transfer to the oven. Do NOT overfill the baking cups. Bake for 18 minutes, rotating the pans halfway through the baking process. Remove from the oven and allow to cool completely on a wire rack.
Ice the Cupcakes:
Add a generous mound of frosting to the top of each cupcake.
If desired, melt chocolate wafers according to package directions and drizzle over the frosted cupcakes. Allow to set 30 minutes, serve and enjoy.