Combine flour, cornstarch, baking soda, and salt in a bowl.
In a stand mixer with a paddle attachment, beat butter, brown sugar, and granulated sugar on high for 3 minutes.
Add the egg, egg yolk, and vanilla, mixing well.
Gradually add dry ingredients and mix on low until just combined.
Fold in chocolate chips and caramel pieces with a spatula.
Cover the dough with plastic wrap and chill in the refrigerator for at least 2 hours or up to 3 days.
Preheat the oven to 350°F and line two baking sheets with parchment paper.
Scoop dough into balls and arrange on the prepared sheets.
Bake for 8 minutes, then rotate pans and bake for another 3–4 minutes until edges are lightly golden.
Sprinkle cookies immediately with flaky sea salt.
Let cool completely before serving.