Hi,
What GameObject is that code's script on? If it's on the Dialogue Manager, make sure you call Lua.RegisterFunction() in Awake() or at least don't unregister it in OnDisable(). Otherwise, if a Dialogue Manager in the first scene registers it, and then you change to another scene with another Dialogue Manager, that other Dialogue Manager could unregister it as it's destroyed.
Another possibility: When making a build, Unity may make the build smaller by stripping out code that it thinks is unused.
It may be stripping out your IncrementEnervation method. To prevent this, turn off code stripping or edit a link.xml file to include the script/assembly. There's a link.xml file in the Dialogue System folder hierarchy. More info:
Managed code stripping.