You can use a script inside a function score directly in the rescorer:
"rescore_query" : {
"function_score" : {
"script_score": {
"script": {
"inline": "_score * ...."
}
}
}
}
You can access the original score in the script with the special field _score.