In a medium saucepan set over medium heat, whisk the sugar, flour, cornstarch, salt, and cocoa together.
1½ cups granulated sugar, ¼ cup all-purpose flour, 5 tablespoons Dutch-processed or regular cocoa powder, 3 tablespoons cornstarch, 1 teaspoon kosher salt
Slowly add the milk, while whisking briskly, and beat until smooth.
1½ cups milk
Cook, whisking constantly (and scraping the sides and corners of the pan) until mixture boils.
Reduce heat to medium-low, and continue cooking and whisking until mixture is very thick, about 4-8 minutes. Transfer the mixture to a wide bowl, and place plastic-wrap directly on the surface of the chocolate/milk mixture. Set aside to cool completely, about 2 hours.
Once the chocolate/milk mixture has cooled, fit a stand mixer with the paddle attachment and add the butter to mixing bowl.
1½ cups unsalted butter
Beat the butter on medium-high speed until lighter in color and fluffy, about 5 minutes.
Reduce speed to medium speed and add the cooled chocolate/milk mixture and vanilla. Beat together, scraping down the inside of the bowl as needed, until incorporated.
2 teaspoons pure vanilla extract
Increase the speed to medium-high and beat until frosting is light and fluffy, about 3-5 minutes, scraping down the sides as needed.
Add the melted (and cooled) chocolate, and beat until melted chocolate is incorporated, about 30 seconds.
3¾ ounces semisweet chocolate
Frost the cake with the completed chocolate frosting, cut into slices, and serve.