Use the code below on php form plugin with Process script = onAfterProcess
$ids = '{tablename___id}';
$ui = '{tablename___user_id_raw}'; // User element
$cp = '{tablename___current_password}'; // Field element with input type = Password
$np = '{tablename___new_password}'; // Password element

$db1 = JFactory::getDBO();
$db1->setQuery("SELECT `new_password` FROM `tablename` WHERE `id` = '$ids'");
$db1 = $db1->loadResult();

$db2 = JFactory::getDBO();
$db2->setQuery("SELECT `password` FROM `#__users` WHERE `id` = '$ui'"); // Get current password from table users.
$db2 = $db2->loadResult();

$match = JUserHelper::verifyPassword($cp, $db2, $ui);

$app = JFactory::getApplication();

if ($match === true) {
  $update = JFactory::getDBO();
  $update->setQuery("UPDATE `#__users` SET `password` = '$db1' WHERE `id` = '$ui'");
  $update->execute();
  $app->enqueueMessage('Password Change Successful.');
} else {
  $app->enqueueMessage('Invalid Current Password.');
}