How to alter taxes amounts when updating an order

Well, I succeeded in filtering the output of the totals :

add_filter( 'woocommerce_order_get_tax_totals', 'filter_function_name_1942', 10, 2 );
function filter_function_name_1942( $tax_totals, $order ){
    
    foreach( $tax_totals as $single_tax_key => $single_tax_value ){
        if( $single_tax_value->rate_id == 1){
            $tax_totals[$single_tax_key]->amount = 1000;
            $tax_totals[$single_tax_key]->formatted_amount = wc_price('1000');
        }
    }
    
    return $tax_totals;
}

It’s just an example with hardcoded values, but it works.

The problem I see now is that with this way the value displayed is right but the value recorded in the database is still wrong (I suppose).
I’m right ?
Is it necessary to save the good value in the database too ? if the value is used by an other plugin for example.
If yes, an idea about how to do it ? I can’t find a method to save the custom value