Heat the butter and chocolate chips in a small saucepan over medium heat, stirring occasionally, then take the pan off the heat and allow about 15 minutes for cooling. The mixture should become smooth and lose its intense heat before it meets the eggs.
Whisk the flour, cocoa powder, baking powder, and salt in a large bowl, then keep this mixture aside. An even color with no visible cocoa pockets helps distribute the dry ingredients throughout the dough.
Beat the brown sugar, eggs, and vanilla in a separate large mixing bowl until smooth. The ingredients should form one consistent mixture rather than separate streaks of egg and sugar.
Stir the cooled chocolate mixture into the egg mixture until the color is uniform. Cooling the chocolate first helps prevent the hot mixture from cooking the eggs.
Incorporate the dry mixture gradually while stirring, stopping when no dry patches remain. The finished dough will be thick but still too soft to shape like ordinary cookie dough.
Seal the bowl with a lid or plastic wrap and refrigerate the dough for 1 to 2 hours. Look for a firm, scoopable consistency that holds its shape rather than flowing back into the bowl.
Set the oven to 325°F and cover one or two baking sheets with parchment paper. The parchment provides a surface that releases the soft chocolate cookies more easily.
Form the chilled dough into balls measuring 1 1/2 to 2 inches across and arrange them at least a couple of inches apart on the prepared sheets. Each portion should hold a rounded shape, with open space around it for spreading.
Bake the dough portions for 10 minutes before adding any toppings. Small cracks should begin appearing across the cookie tops at this stage.
During the initial bake, halve the marshmallows and cut the chocolate bar into 1/2-inch pieces. Keep the marshmallow cut surfaces exposed so they are ready to face downward.
Pull the sheet from the oven, place a chocolate piece on each cookie, cover it with a marshmallow half cut side down, and bake for another 3 to 4 minutes. The marshmallow should expand into a soft, gooey cap rather than collapse into a thin puddle.
Take the baking sheet out of the oven and leave the cookies on it for about 5 minutes. This brief rest lets the tender cookie bottoms firm enough for moving.
Add grated chocolate over the marshmallow tops if desired. The warm topping helps the chocolate shavings cling to the surface.
Move the cookies to a cooling rack for further cooling, or enjoy them warm. The centers remain soft, and the warm marshmallow has its stretchiest texture.