@XGuarden you could do exactly what Silenity said, but with script calls.
Just remove 99 of the object: You now have 0 of the object.
Then add the desired quantity: You now have [quantity] of the object.
Congratulations: You have "set" the item quantity to the [quantity].
This works just fine:
$gameParty.gainItem($dataItems[itemId], -99);
$gameParty.gainItem($dataItems[itemId], your_quantity);
I didn't test
@Kadafi's solutions, I'm sure it would work but it's likely a bit overkill for something so simple. Unless there's something I'm missing.
Edit: Below is the way to directly influence item quantity.
I'm providing it because that's what you're asking for, but you shouldn't mess with it: referencing objects the party doesn't have or inputting something that isn't a number as a quantity will likely bug your game.
Using the way I described above is much safer.
$gameParty._items["your_item_id"] = your_quantity
You can access weapons and armors too if you want.