You can try Verifypassword JavaAction from the system module which is by default present in your mendix projects.
or
You can also have a look at this Forum link : https://forum.mendix.com/link/space/other/questions/8351
Might get some idea!!
ATB
Can you verify the hashed password with the current password?
Or, you let the user fill in his/her current password and validate the new password against the current password. If those input fields are the same, throw an error.