You will need game:set_ability("sword_knowledge", 0) or something. Most of the documentation is around the paired get_ability.
https://www.solarus-games.org/doc/latest/lua_api_game.html#lua_api_game_get_ability
https://www.solarus-games.org/doc/latest/lua_api_game.html#lua_api_game_get_ability