Creating confirmation windows

Greetings people,

I have a plugin that will save files. I want to create a simple modal window which will ask the user if they want to overwrite the file in the directory if the file exists.

I looked into how photoshop saves files and from the documentation, it seems that the only options are that the file is either always overwritten without any dialog, or it doesn’t save at all. At least, that’s how it sounded to me. Documentation in question

Now, what would be the best way to do this? If there is a way of doing this wihtout having to create my own modal window, that would be great, however, looking around that doesn’t seem to be possible.

If I have to create my own modal window, then how? I looked around the forums as well as the documentation. I got some code but nothing ever worked. It always ended up with me having zero errors but modal window not showing up.

Last question, bit off-topic, what do you use for documentation. To me from what I looked around, it seems all over the place. Especially for JS. On the official Documentation for uxp api and photoshop api, I never found what I was looking for. The closest documentation I found to what I needed for Photoshop was located underneath Adobe XD instead.

Much thanks to whoever decides to help