The following is a crude example, it can be improved to ensure you’re dealing with integers etc and also shortened overall for brevity but this should get you started.
add_filter('frm_after_create_entry', 'after_entry_created', 30, 2);
function after_entry_created($entry_id, $form_id){
global $post;
if($form_id == 7){ //change 7 to the ID of your form
$previous_value = get_post_meta($post_id, $key, true);
if($previous_value == null) {
$value = 12345; //this is a starting value if nothing set
$previous_value = $value;
$value = $previous_value - 1; //returns 12344
} else {
$value = $previous_value - 1; //returns whatever previous value was - 1
}
update_post_meta($post->ID, $key, $value, $previous_value);
}
}
I’m making some assumptions without knowing if you are working with a starting value or not, but this should get you going in the right direction.