To make the cake: Preheat oven to 350°F/180°C. Grease a 9×13-inch pan or line with parchment paper, leaving enough overhang on the sides for lifting the cake out of the pan after baking. Set aside.
In a medium bowl, sift together flour, baking powder, and salt. Set aside.
In a small saucepan, combine butter and milk over medium heat just until butter is melted. Do not let it boil. Set aside.
In the bowl of a stand mixer fitted with the whisk attachment, or using a hand mixer, whisk eggs on high speed until combined and starting to foam, about 1 minute. Gradually add sugar and keep whisking until tripled in volume, about 5 minutes. Beat in vanilla.
Reduce speed to medium-low and add warm milk mixture into the egg mixture in a slow, steady stream. Add flour mixture gradually and whisk just until combined.
Pour batter into prepared cake pan. Bake for 25-35 minutes until the cake springs back when slightly touched and a skewer inserted into the center comes out clean. Allow cake to cool on a wire rack for 20 minutes, then run a knife around the edges. Invert the pan onto the rack, lift it off and let the cake continue to cool on the rack.
To make the syrup: stir together hot coffee and sugar until sugar is dissolved, then add liqueur, if using. Allow to cool.
While the cake is till warm, poke lots of holes in the cake with a fork or toothpick. Brush with coffee syrup or pour the syrup over the cake slowly and gradually, allowing it to soak in. Use all the syrup.
To make the frosting: In the bowl of an electric mixer fitted with the whisk attachment, whisk mascarpone, sugar, and liqueur, if using, on medium speed until combined. Add heavy cream gradually, then increase the speed to high and whisk until stiff peaks form and frosting is thick. Use immediately to frost cake. Just before serving, dust frosting lightly with cocoa powder.
Keep cake in the fridge for up to 4 days.