First, add all caramel ingredients aside from the cornstarch to a pot and melt together on the stove. Bring to a low boil for just a minute or so, then remove from heat. Once it has started to cool slightly, whisk in the cornstarch really well until combined. With this recipe, you don't want to add the cornstarch while it's too hot or it'll get a bit goopy. The cornstarch will work its thickening magic as the caramel chills anyway, so no need to boil it. Transfer to a jar and set in the fridge for at least 30 minutes (ideally more) to harden and chill. After 30 minutes, give it a really good stir. If it isn't thickening, pop it in the freezer for about 15 minutes, just be sure it's covered.
Preheat the oven to 350 degrees Fahrenheit.
In a large mixing bowl or bowl of a stand mixer, cream together the butter and sugar.
Beat in the melted chocolate, egg and vanilla.
Add in all remaining dry ingredients, measuring the cocoa and flour by spooning it into the measuring cup and leveling off the top.
Fold together until a dough forms.
Use a small cookie scoop or about 1- 1.5 tbsp and roll into balls. It might seem kind of sticky, it helps to lightly oil the cookie scoop and use very slightly damp hands to roll.
Take the bottom of a flat cup or bowl and press down on the cookies slightly, just to flatten a bit. Use a 1/2 teaspoon or a wine cork to make intends in the center of the cookies. Place in the fridge for 15 minutes to chill to ensure the cookies hold their shape while baking.
Bake for 9-11 minutes.
Remove from the oven and repress the wells in the center, they sometimes fill up a bit while baking.
Let cool completely, then fill with the caramel. Drizzle with more melted chocolate if desired and sprinkle with sea salt.