Did anyone figure out how to refresh autotiles?

I suppose this is internal (hidden) code? Because I can't find how RM does this when placing a tile in the editor.

If I have an autotile but it's the wrong one (shift-placed). How can I update it through code (@runtime) so it becomes the proper autotile? I of course know the x and y and mapdata of the tile and can also use Game_Map.prototype.autotileType() to request the type. But how to actually update it to the proper type?

In Ace this was a complete horror (required tons of methods and lots of weird calculations without documentation). Is this better in MV now and if so, how can we do it?
MV itself doesn't know what the "proper" autotile is. Each possibility of an autotile has its own id, that is set by the editor. If you want to change that at runtime, you'll have to calculate the correct id.
Crap... Maybe I could commission someone? And double-crap now I need to move this topic to the commission-section. Ah I'll just make a new topic.

Original thread: https://forums.rpgmakerweb.com/threads/did-anyone-figure-out-how-to-refresh-autotiles.52208/