Type Name from App Type Field

I’ve been using properties.myDataType.replace('custom.', '') to get the type name for my custom data types for the Data API, which has been working a dream, until I came across a Data Type where I had changed the name, and sadly this method gets the ID for the data type (its old name), not its actual (new) name.

So, assuming I have a data type I called Some Old Name, which I replaced with The Name I Want

properties.myDataType.replace('custom.', '') = someoldname which means my code breaks

Is there a workaround for this (other than directly passing the typename to the plugin)?