Pre-heat oven to 180°C (160°C fan-forced). Line 18 muffin holes with paper cases.
Place butter, sugar and vanilla in the bowl of an electric mixer. Beat until pale and creamy. Add eggs one at a time, mixing until well incorporated.
Fold in the cake flour, baking powder, coconut and milk, alternately, mixing until batter is well combined. Spoon between paper cases and bake for 18-20 minutes. Allow to cool before decorating.
To assemble the ghosts – spread a little icing on each cupcake and press a marshmallow on top.
Lightly dust a work surface with some icing sugar. Roll out fondant to 3mm thickness and use a cutter to cut out 18 x rounds. Drape the fondant over the top of each marshmallow and gently pinch the skirt to create a ghost form. Allow the fondant to firm up for 30 minutes before using an edible black pen to draw on ghost eyes and mouth.