Start by putting the milk in a pot over medium heat.
In a bowl, whisk the sugar, salt, corn flour and egg yolks together.
Once the milk starts to simmer (don't let it boil), slowly pour it into the egg mixture while whisking at the same time.
Pour it all back into the pot and heat on low until it thickens, mixing constantly. If there are any lumps, push it through a sieve. Cover and let it cool in the fridge.
For the cookies, melt the butter and let it cool. Whisk in both sugars, then add the egg and vanilla.
In a separate bowl, mix the flour, salt, baking powder and baking soda, then add this to the butter mixture.
Scoop out the dough onto a tray (about 100g each; this makes 7). Chill in the fridge for 30 minutes, then bake at 190C for about 20 minutes.
Once the cookies and custard are cold, pipe the custard on top, add a thin layer of sugar and blow-torch it to melt the sugar. Let cool a minute and they're done.