The following syntax in an object's create event:
#lambda damagePlayer(dmg) {
hp -= dmg;
}
will instruct gml-tools to create (or update) a "private" script on compile. The scripts would be stored in scripts/lambdas/obj_name_here/function_name_here, or alternatively, could all be stored in a view not connected to the visible resource tree.
Additionally, all generated functions could have:
if (object_index != <lambda object owner here>) return;
at the top of their code.