In a bowl, mix cornstarch with ¼ cup sugar. Add yolks and whisk until smooth. Place the milk, ¼ cup sugar and vanilla in a saucepan over low heat and bring to a boil. Remove from the heat, and slowly add a few tablespoons of hot milk to the yolk mixture, stirring all the time, until they are warm. This is done so as to temper the eggs. Then, transfer all the mixture back to the saucepan and back to the heat, stirring constantly for about 3 minutes. The pastry cream will thicken very quickly, but it is very important to cook the cornstarch. Turn off the heat, add the chocolate and butter. Let it stand for a couple of minutes and mix to combine. Pour into a bowl, cover directly with plastic wrap to stop a skin from forming on the cream. Let it cool and chill.