In a small pot off the heat, whisk together the sugar and cornstarch. Add the egg yolks and mix well. Add the milk. Bring to a boil over medium heat, stirring constantly and scraping the bottom and sides of the pot, just until the mixture thickens. Remove from the heat. Strain through a sieve to remove any lumps, as needed. Add the chocolate and whisk until melted and smooth.