In a pot in a water bath, heat the sugar to melt it, with the water, chocolate and cocoa. Stir until the sugar completely melts. Separately, beat the egg yolks with a fork and while stirring continuously, add them to the chocolate-cocoa mixture.
After stirring a few more times, remove it from the heat and let it cool. Beat the butter in another container with a mixer until creamy and gradually add batches of the chocolate mixture to it.