I haven't tried it myself for this recipe but it should work. I'd recommend using the coconut oil while it's solid or slightly softened and adding a generous pinch of salt to mimic the buttery flavor. Coconut oil melts at a lower temperature than butter so I'd recommend chilling your dough before you bake them. Cookies made with coconut oil will change the depth of flavor of the final result.