Hello,
thank you for your willingness 
Despite it looks it should work it doesn't. When I putted your code to my plugin's function it redirected me to blank page with link:
I have just another question to this topic.
My plugin, which reset car onBeforeCartUpdate
$cartClass->resetCart();
$cartClass = hikashop_get('class.cart');
$cartClass->resetCart();
$cartContent = $cartClass->get();
$cartClass->updateEntry($quantity,$cartContent,(int)$product_id,1,false,$type,$force);
If I have expired cookies and I would add product it prints error message: The cart is empty.
In second try it works but just until cookies expired.
Is there any condition which check if is cookies for cart exists?
Good bless you
Filip