How to overwrite/create "raw" UFunction?

By sound of what you trying to make, i think it’s gonna be a lot easier to just make (and most impotently understand) your own UK2Node (K2 means Kismet 2 as blueprints are UE3 Kismet successor, this name i still used in source code).

Each node type in Blueprints has it’s own UK2Node class, defining appearance of node and what VM code in generates:

For example all function call nodes (nodes with “f” icon) are contained in single class as single UK2Node can create multiple nodes of same type, in this case, for each exposed function

Making UK2Node not only let you control what is executed and generly create your own VM code, but also appernce of node, what pins it can have and such. It gives you a hell lot more options then trying to hack UFunctions.

In fact Epic does something that you want too, they created UK2Node specifically for SpawnActor and only reason why they did that insted of using normal UFunction binding is to auto cast the output node to type of spawned actor. And i think this is great start point for oyu to learn as it’s most similar to what you trying to do which sound like specially called function:

https://github.com/EpicGames/UnrealEngine/blob/bf95c2cbc703123e08ab54e3ceccdd47e48d224a/Engine/Source/Editor/BlueprintGraph/Private/K2Node_SpawnActor.cpp

One note, UK2Node are editor only classes, so you would need to create editor only module (set that in uproject or uplugin whatever yo working on). UK2Nodes don’t get in to run time, since once they generate VM code during packaging, they are no needed.