IDK if this is reasonable since HATE's data handling works as-is for Undertale, but I want to suggest to use UndertaleModLib for reading and generating data.win file. It's the data handling library used in UndertaleModTool, and it will likely make development a little bit easier, and there's also a extra benefit that it may support Deltarune Chapter 1&2 better, as well as allowing data files corrupted by HATE to be viewable in UMT.
IDK if this is reasonable since HATE's data handling works as-is for Undertale, but I want to suggest to use UndertaleModLib for reading and generating data.win file. It's the data handling library used in UndertaleModTool, and it will likely make development a little bit easier, and there's also a extra benefit that it may support Deltarune Chapter 1&2 better, as well as allowing data files corrupted by HATE to be viewable in UMT.